tests: don't assume a .git/info for .git/info/refs
Change those tests that assumed that a .git/info directory would be created for them when writing .git/info/refs to explicitly create the directory by using the "--template=" argument to "git init". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jun 3, 2022 at 13:15 UTC
ce5369e3ef0078458a0608be9ddeb2b276e61b62
2 files changed
+4
-2
t/t1301-shared-repo.sh
+2
-1
@@ -48,7 +48,7 @@ done
48
test_expect_success 'shared=all' '
49
mkdir sub &&
50
cd sub &&
51
- git init --shared=all &&
51
+ git init --template= --shared=all &&
52
test 2 = $(git config core.sharedrepository)
53
'
54
@@ -57,6 +57,7 @@ test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository'
57
git add a1 &&
58
test_tick &&
59
git commit -m a1 &&
60
+ mkdir .git/info &&
61
umask 0277 &&
62
git update-server-info &&
63
actual="$(ls -l .git/info/refs)" &&
t/t5550-http-fetch-dumb.sh
+2
-1
@@ -422,7 +422,8 @@ test_expect_success 'set up evil alternates scheme' '
422
sha1=$(git -C "$victim" rev-parse HEAD) &&
423
424
evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
425
- git init --bare "$evil" &&
425
+ git init --template= --bare "$evil" &&
426
+ mkdir "$evil/info" &&
427
# do this by hand to avoid object existence check
428
printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
429
'