Support older git

The -b flag is available since 2.28, but Ubuntu 20.04 uses 2.25.
This commit is contained in:
Nobuyoshi Nakada 2023-04-28 18:29:18 +09:00
parent 9b07d30df8
commit 35da0d4a6e
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6
Notes: git 2023-04-28 10:23:57 +00:00

View File

@ -84,13 +84,14 @@ module Test_SyncDefaultGems
ENV["GIT_CONFIG_GLOBAL"] = @testdir + "/gitconfig"
system(*%W"git config --global user.email test@ruby-lang.org")
system(*%W"git config --global user.name", "Ruby")
system(*%W"git config --global init.defaultBranch default")
@target = "sync-test"
SyncDefaultGems::REPOSITORIES[@target.to_sym] = ["ruby/#{@target}", "default"]
@sha = {}
@origdir = Dir.pwd
Dir.chdir(@testdir)
["src", @target].each do |dir|
system(*%W"git init -q -b default #{dir}", exception: true)
system(*%W"git init -q #{dir}", exception: true)
Dir.mkdir("#{dir}/tool")
File.write("#{dir}/tool/ok", "#!/bin/sh\n""echo ok\n")
system(*%W"git add tool/ok", exception: true, chdir: dir)