]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: don't assume a .git/info for .git/info/refs
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 3 Jun 2022 11:15:07 +0000 (13:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2022 19:00:21 +0000 (12:00 -0700)
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>
t/t1301-shared-repo.sh
t/t5550-http-fetch-dumb.sh

index 84bf1970d8bfe7b13327fb0d66f691dcfa58cbb0..93a2f91f8a5181c5307c6de14ab6f2823d2b959a 100755 (executable)
@@ -48,7 +48,7 @@ done
 test_expect_success 'shared=all' '
        mkdir sub &&
        cd sub &&
-       git init --shared=all &&
+       git init --template= --shared=all &&
        test 2 = $(git config core.sharedrepository)
 '
 
@@ -57,6 +57,7 @@ test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository'
        git add a1 &&
        test_tick &&
        git commit -m a1 &&
+       mkdir .git/info &&
        umask 0277 &&
        git update-server-info &&
        actual="$(ls -l .git/info/refs)" &&
index f0d9cd584d3b1865490994f6ce85a7917e3bf129..3ca621f33b5b2d102c90e224e0c45ddac516b305 100755 (executable)
@@ -422,7 +422,8 @@ test_expect_success 'set up evil alternates scheme' '
        sha1=$(git -C "$victim" rev-parse HEAD) &&
 
        evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
-       git init --bare "$evil" &&
+       git init --template= --bare "$evil" &&
+       mkdir "$evil/info" &&
        # do this by hand to avoid object existence check
        printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
 '