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 <tap_name> && 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.
This commit is contained in:
Gibson Fahnestock 2021-02-09 15:29:54 +00:00
parent c1bd17e1c9
commit 0f48498ad8
No known key found for this signature in database
GPG Key ID: B01FBB92821C587A

View File

@ -296,6 +296,10 @@ class Tap
$stderr.ohai "Tapping #{name}" unless quiet $stderr.ohai "Tapping #{name}" unless quiet
args = %W[clone #{requested_remote} #{path}] 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 << "--depth=1" unless full_clone
args << "-q" if quiet args << "-q" if quiet