Skip to content

Commit fda777f

Browse files
committed
Fix test case for #587
+ fix test when `init.defaultBranch` is not set by assigning default value Signed-off-by: lijunwei <ljw532344863@sina.com>
1 parent 323383b commit fda777f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/units/test_init.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def test_git_init
3838
assert(File.directory?(File.join(path, '.git')))
3939
assert(File.exist?(File.join(path, '.git', 'config')))
4040
assert_equal('false', repo.config('core.bare'))
41-
assert_equal("ref: refs/heads/master\n", File.read("#{path}/.git/HEAD"))
41+
42+
branch = `git config --get init.defaultBranch`.strip
43+
branch = 'master' if branch.empty?
44+
assert_equal("ref: refs/heads/#{branch}\n", File.read("#{path}/.git/HEAD"))
4245
end
4346
end
4447

0 commit comments

Comments
 (0)