From 246eabac01f9d65c328bd8bec86a38d20d2a34bf Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 7 Oct 2022 18:33:35 +0100 Subject: [PATCH 1/2] formula_auditor: support non-master default branch for downgrade audit --- Library/Homebrew/formula_auditor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index b68a81f3df..e67e546937 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -731,7 +731,7 @@ module Homebrew newest_committed_revision = nil newest_committed_url = nil - fv.rev_list("origin/master") do |rev| + fv.rev_list("origin/HEAD") do |rev| begin fv.formula_at_revision(rev) do |f| stable = f.stable From af234779af9a8d83b6a7e68292cee369d5527ca9 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 7 Oct 2022 18:33:58 +0100 Subject: [PATCH 2/2] test: support non-master init.defaultbranch --- Library/Homebrew/test/cmd/install_spec.rb | 2 +- Library/Homebrew/test/dev-cmd/audit_spec.rb | 2 +- Library/Homebrew/test/dev-cmd/bottle_spec.rb | 6 +++--- Library/Homebrew/test/download_strategies/git_spec.rb | 2 +- Library/Homebrew/test/formula_spec.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index c7a4bba552..c3aef27000 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -45,7 +45,7 @@ describe "brew install" do repo_path.join("bin").mkpath repo_path.cd do - system "git", "init" + system "git", "-c", "init.defaultBranch=master", "init" system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" FileUtils.touch "bin/something.bin" FileUtils.touch "README" diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index f05566a10e..56031ac601 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -927,7 +927,7 @@ module Homebrew tap_path.cd do system "git", "fetch" - system "git", "reset", "--hard", "origin/master" + system "git", "reset", "--hard", "origin/HEAD" end end diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 476cd816da..6c4f5510fc 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -80,7 +80,7 @@ describe "brew bottle" do it "adds the bottle block to a formula that has none" do core_tap.path.cd do - system "git", "init" + system "git", "-c", "init.defaultBranch=master", "init" setup_test_formula "testball" system "git", "add", "--all" system "git", "commit", "-m", "testball 0.1" @@ -140,7 +140,7 @@ describe "brew bottle" do it "replaces the bottle block in a formula that already has a bottle block" do core_tap.path.cd do - system "git", "init" + system "git", "-c", "init.defaultBranch=master", "init" setup_test_formula "testball", bottle_block: <<~EOS bottle do @@ -207,7 +207,7 @@ describe "brew bottle" do it "updates the bottle block in a formula that already has a bottle block when using --keep-old" do core_tap.path.cd do - system "git", "init" + system "git", "-c", "init.defaultBranch=master", "init" setup_test_formula "testball", bottle_block: <<~EOS bottle do diff --git a/Library/Homebrew/test/download_strategies/git_spec.rb b/Library/Homebrew/test/download_strategies/git_spec.rb index a9d8e6215b..eb7010669a 100644 --- a/Library/Homebrew/test/download_strategies/git_spec.rb +++ b/Library/Homebrew/test/download_strategies/git_spec.rb @@ -23,7 +23,7 @@ describe GitDownloadStrategy do end def setup_git_repo - system "git", "init" + system "git", "-c", "init.defaultBranch=master", "init" system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" FileUtils.touch "README" git_commit_all diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 6aeb223eff..6c8a74c93c 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1480,7 +1480,7 @@ describe Formula do testball_repo.cd do FileUtils.touch "LICENSE" - system("git", "init") + system("git", "-c", "init.defaultBranch=master", "init") system("git", "add", "--all") system("git", "commit", "-m", "Initial commit") end