On the current version of the bin/update-brew script, it uses hardcoded references to origin/master and will error on any brew repository that uses main as its primary branch name.
Latest commit where bug occurs:commit 0dae5dd742d12dd06df72f401d003b300d66491f
Current behavior:
Output of running bash -x bin/update-brew
$ bash -x bin/update-brew
+ set -euf
+ command -v brew
+++ whoami
++ id -u nate
+ this_uid=501
+++ brew --cellar
++ stat -f %u /opt/homebrew/Cellar
+ brew_uid=501
+ '[' 501 -eq 501 ']'
+ arg_verbose=
+ '[' -n '' ']'
+ arg_debug=
+ '[' -n '' ']'
+ brew cleanup
++ brew tap
+ for tap in '$(brew tap)'
++ brew --repo 1password/tap
+ repo=/opt/homebrew/Library/Taps/1password/homebrew-tap
+ cd /opt/homebrew/Library/Taps/1password/homebrew-tap
+ git clean -dfx
+ git reset --hard origin/master
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
We can verify the expected branch name is main here
Bug Report
On the current version of the
bin/update-brew
script, it uses hardcoded references to origin/master and will error on any brew repository that uses main as its primary branch name.Latest commit where bug occurs:
commit 0dae5dd742d12dd06df72f401d003b300d66491f
Current behavior: Output of running
bash -x bin/update-brew
We can verify the expected branch name is
main
hereExpected behavior:
The
bin/update-brew
script should properly execute regardless of primary branch name and make all updates as normal.Steps to reproduce:
Executing
bin/update-brew
against any homebrew tap repository that uses main as its branch name will result in this bug.Related code:
The relevant commands are on lines 56 and 57
Other information:
I will submit and link a PR with a propose fix if needed.