Stop using shallow clones for taps
This commit is contained in:
parent
2dc6ff13cf
commit
674594f75c
@ -27,11 +27,6 @@ module Homebrew
|
||||
assumptions, so taps can be cloned from places other than GitHub and
|
||||
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
|
||||
EOS
|
||||
switch "--full",
|
||||
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
|
||||
"shallow clones if `--shallow` was originally passed."
|
||||
switch "--shallow",
|
||||
description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
|
||||
switch "--force-auto-update",
|
||||
description: "Auto-update tap even if it is not hosted on GitHub. By default, only taps "\
|
||||
"hosted on GitHub are auto-updated (for performance reasons)."
|
||||
@ -56,18 +51,11 @@ module Homebrew
|
||||
elsif args.no_named?
|
||||
puts Tap.names
|
||||
else
|
||||
full_clone = if args.full?
|
||||
true
|
||||
else
|
||||
!args.shallow?
|
||||
end
|
||||
odebug "Tapping as #{full_clone ? "full" : "shallow"} clone"
|
||||
tap = Tap.fetch(args.named.first)
|
||||
begin
|
||||
tap.install clone_target: args.named.second,
|
||||
force_auto_update: force_auto_update?(args: args),
|
||||
quiet: args.quiet?,
|
||||
full_clone: full_clone
|
||||
quiet: args.quiet?
|
||||
rescue TapRemoteMismatchError => e
|
||||
odie e
|
||||
rescue TapAlreadyTappedError
|
||||
|
@ -244,9 +244,8 @@ class Tap
|
||||
# @param clone_target [String] If passed, it will be used as the clone remote.
|
||||
# @param force_auto_update [Boolean, nil] If present, whether to override the
|
||||
# logic that skips non-GitHub repositories during auto-updates.
|
||||
# @param full_clone [Boolean] If set as true, full clone will be used. If unset/nil, means "no change".
|
||||
# @param quiet [Boolean] If set, suppress all output.
|
||||
def install(full_clone: true, quiet: false, clone_target: nil, force_auto_update: nil)
|
||||
def install(quiet: false, clone_target: nil, force_auto_update: nil)
|
||||
require "descriptions"
|
||||
require "readall"
|
||||
|
||||
@ -270,11 +269,13 @@ class Tap
|
||||
if installed?
|
||||
unless force_auto_update.nil?
|
||||
config["forceautoupdate"] = force_auto_update
|
||||
return if !full_clone || !shallow?
|
||||
return
|
||||
end
|
||||
|
||||
$stderr.ohai "Unshallowing #{name}" unless quiet
|
||||
args = %w[fetch --unshallow]
|
||||
$stderr.ohai "Unshallowing #{name}" if shallow? && !quiet
|
||||
args = %w[fetch]
|
||||
# Git throws an error when attempting to unshallow a full clone
|
||||
args << "--unshallow" if shallow?
|
||||
args << "-q" if quiet
|
||||
path.cd { safe_system "git", *args }
|
||||
return
|
||||
@ -288,7 +289,6 @@ class Tap
|
||||
# Override possible user configs like:
|
||||
# git config --global clone.defaultRemoteName notorigin
|
||||
args << "--origin=origin"
|
||||
args << "--depth=1" unless full_clone
|
||||
args << "-q" if quiet
|
||||
|
||||
begin
|
||||
|
Loading…
x
Reference in New Issue
Block a user