From 0f48498ad82d8b0de046a64e38538b6f1e600386 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Tue, 9 Feb 2021 15:29:54 +0000 Subject: [PATCH] fix(tap): set clone remote name to origin explicitly Git now allows setting a different default remote name than `origin` when you do a fresh clone by running: ```shell git config --global clone.defaultRemoteName notorigin ``` This causes `brew tap && brew update` to fail, as it clones with a different remote name in the `tap` and then expects the remote to be `origin` in the `update`. Fix this by explicitly setting the origin remote in the clone command. --- Library/Homebrew/tap.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 9c1d44cbf1..f6a5a1bf80 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -296,6 +296,10 @@ class Tap $stderr.ohai "Tapping #{name}" unless quiet args = %W[clone #{requested_remote} #{path}] + + # Override possible user configs like: + # git config --global clone.defaultRemoteName notorigin + args << "--origin=origin" args << "--depth=1" unless full_clone args << "-q" if quiet