@@ -11,16 +11,18 @@ export GIT_TEST_REFTABLE_AUTOCOMPACTION
1111# Block sizes depend on the hash function, so we force SHA1 here.
1212GIT_TEST_DEFAULT_HASH=sha1
1313export GIT_TEST_DEFAULT_HASH
14- # Block sizes also depend on the actual refs we write, so we force "master" to
15- # be the default initial branch name.
16- GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
17- export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1814
1915. ./test-lib.sh
2016
17+ # Block sizes depend on the actual refs we write, so, for tests
18+ # that check block size, we force the initial branch name to be "master".
19+ init_repo () {
20+ git init --initial-branch master repo
21+ }
22+
2123test_expect_success ' default write options' '
2224 test_when_finished "rm -rf repo" &&
23- git init repo &&
25+ init_repo &&
2426 (
2527 cd repo &&
2628 test_commit initial &&
@@ -43,7 +45,7 @@ test_expect_success 'default write options' '
4345test_expect_success ' disabled reflog writes no log blocks' '
4446 test_config_global core.logAllRefUpdates false &&
4547 test_when_finished "rm -rf repo" &&
46- git init repo &&
48+ init_repo &&
4749 (
4850 cd repo &&
4951 test_commit initial &&
@@ -62,7 +64,7 @@ test_expect_success 'disabled reflog writes no log blocks' '
6264
6365test_expect_success ' many refs results in multiple blocks' '
6466 test_when_finished "rm -rf repo" &&
65- git init repo &&
67+ init_repo &&
6668 (
6769 cd repo &&
6870 test_commit initial &&
@@ -115,7 +117,7 @@ test_expect_success 'tiny block size leads to error' '
115117test_expect_success ' small block size leads to multiple ref blocks' '
116118 test_config_global core.logAllRefUpdates false &&
117119 test_when_finished "rm -rf repo" &&
118- git init repo &&
120+ init_repo &&
119121 (
120122 cd repo &&
121123 test_commit A &&
@@ -172,7 +174,7 @@ test_expect_success 'block size exceeding maximum supported size' '
172174
173175test_expect_success ' restart interval at every single record' '
174176 test_when_finished "rm -rf repo" &&
175- git init repo &&
177+ init_repo &&
176178 (
177179 cd repo &&
178180 test_commit initial &&
@@ -212,7 +214,7 @@ test_expect_success 'restart interval exceeding maximum supported interval' '
212214test_expect_success ' object index gets written by default with ref index' '
213215 test_config_global core.logAllRefUpdates false &&
214216 test_when_finished "rm -rf repo" &&
215- git init repo &&
217+ init_repo &&
216218 (
217219 cd repo &&
218220 test_commit initial &&
@@ -247,7 +249,7 @@ test_expect_success 'object index gets written by default with ref index' '
247249test_expect_success ' object index can be disabled' '
248250 test_config_global core.logAllRefUpdates false &&
249251 test_when_finished "rm -rf repo" &&
250- git init repo &&
252+ init_repo &&
251253 (
252254 cd repo &&
253255 test_commit initial &&
0 commit comments