From 674594f75cee21eb05b04e8b0cac22ea157e0dfe Mon Sep 17 00:00:00 2001 From: cnnrmnn Date: Thu, 6 May 2021 09:56:30 -0400 Subject: [PATCH] Stop using shallow clones for taps --- Library/Homebrew/cmd/tap.rb | 14 +------------- Library/Homebrew/tap.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index d352143c7a..ed69bc4425 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -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 diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index fad32e455e..21fa052e27 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -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