test: support non-master init.defaultbranch

This commit is contained in:
Bo Anderson 2022-10-07 18:33:58 +01:00
parent 246eabac01
commit af234779af
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
5 changed files with 7 additions and 7 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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