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>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2022-06-03 13:15:07 +02:00
committed by Junio C Hamano
parent 8da0b02d99
commit ce5369e3ef
2 changed files with 4 additions and 2 deletions

View File

@ -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"
'