tap: default to --shallow on CI
This commit is contained in:
parent
2acb4771fe
commit
945fb11d51
@ -25,8 +25,8 @@ module Homebrew
|
|||||||
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
|
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
|
||||||
EOS
|
EOS
|
||||||
switch "--full",
|
switch "--full",
|
||||||
description: "Convert a shallow clone to a full clone without untapping. By default, taps are no "\
|
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
|
||||||
"longer cloned as shallow clones."
|
"shallow clones on continuous integration, or if `--shallow` was originally passed."
|
||||||
switch "--shallow",
|
switch "--shallow",
|
||||||
description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
|
description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
|
||||||
switch "--force-auto-update",
|
switch "--force-auto-update",
|
||||||
@ -53,12 +53,20 @@ module Homebrew
|
|||||||
elsif args.no_named?
|
elsif args.no_named?
|
||||||
puts Tap.names
|
puts Tap.names
|
||||||
else
|
else
|
||||||
|
full_clone = if args.full?
|
||||||
|
true
|
||||||
|
elsif args.shallow?.nil?
|
||||||
|
!ENV["CI"]
|
||||||
|
else
|
||||||
|
!args.shallow?
|
||||||
|
end
|
||||||
|
odebug "Tapping as #{full_clone ? "full" : "shallow"} clone"
|
||||||
tap = Tap.fetch(args.named.first)
|
tap = Tap.fetch(args.named.first)
|
||||||
begin
|
begin
|
||||||
tap.install clone_target: args.named.second,
|
tap.install clone_target: args.named.second,
|
||||||
force_auto_update: force_auto_update?,
|
force_auto_update: force_auto_update?,
|
||||||
quiet: args.quiet?,
|
quiet: args.quiet?,
|
||||||
full_clone: !args.shallow?
|
full_clone: full_clone
|
||||||
rescue TapRemoteMismatchError => e
|
rescue TapRemoteMismatchError => e
|
||||||
odie e
|
odie e
|
||||||
rescue TapAlreadyTappedError
|
rescue TapAlreadyTappedError
|
||||||
|
|||||||
@ -501,7 +501,7 @@ taps can be cloned from places other than GitHub and using protocols other than
|
|||||||
HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
|
HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
|
||||||
|
|
||||||
* `--full`:
|
* `--full`:
|
||||||
Convert a shallow clone to a full clone without untapping. By default, taps are no longer cloned as shallow clones.
|
Convert a shallow clone to a full clone without untapping. Taps are only cloned as shallow clones on continuous integration, or if `--shallow` was originally passed.
|
||||||
* `--shallow`:
|
* `--shallow`:
|
||||||
Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration.
|
Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration.
|
||||||
* `--force-auto-update`:
|
* `--force-auto-update`:
|
||||||
|
|||||||
@ -635,7 +635,7 @@ With \fIURL\fR specified, tap a formula repository from anywhere, using any tran
|
|||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-full\fR
|
\fB\-\-full\fR
|
||||||
Convert a shallow clone to a full clone without untapping\. By default, taps are no longer cloned as shallow clones\.
|
Convert a shallow clone to a full clone without untapping\. Taps are only cloned as shallow clones on continuous integration, or if \fB\-\-shallow\fR was originally passed\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-shallow\fR
|
\fB\-\-shallow\fR
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user