diff --git a/spec/components/version_spec.rb b/spec/components/version_spec.rb index c843a5ce6c5..6d519a22ae5 100644 --- a/spec/components/version_spec.rb +++ b/spec/components/version_spec.rb @@ -106,7 +106,7 @@ describe Discourse::VERSION do # Simulate a remote upstream `cd #{path} && git remote add origin #{path}/.git && git fetch -q` - `cd #{path} && git branch -u origin/main` + `cd #{path} && git branch -u origin/$(git branch --show-current)` end path diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 24af7fd1690..6cc43fc6fb4 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -165,7 +165,7 @@ module Helpers def setup_git_repo(files) repo_dir = Dir.mktmpdir - `cd #{repo_dir} && git init . --initial-branch=main` + `cd #{repo_dir} && git init .` `cd #{repo_dir} && git config user.email 'someone@cool.com'` `cd #{repo_dir} && git config user.name 'The Cool One'` `cd #{repo_dir} && git config commit.gpgsign 'false'`