Skip to content

Commit ce5369e

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8da0b02 commit ce5369e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

t/t1301-shared-repo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ done
4848
test_expect_success 'shared=all' '
4949
mkdir sub &&
5050
cd sub &&
51-
git init --shared=all &&
51+
git init --template= --shared=all &&
5252
test 2 = $(git config core.sharedrepository)
5353
'
5454

@@ -57,6 +57,7 @@ test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository'
5757
git add a1 &&
5858
test_tick &&
5959
git commit -m a1 &&
60+
mkdir .git/info &&
6061
umask 0277 &&
6162
git update-server-info &&
6263
actual="$(ls -l .git/info/refs)" &&

t/t5550-http-fetch-dumb.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ test_expect_success 'set up evil alternates scheme' '
422422
sha1=$(git -C "$victim" rev-parse HEAD) &&
423423
424424
evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
425-
git init --bare "$evil" &&
425+
git init --template= --bare "$evil" &&
426+
mkdir "$evil/info" &&
426427
# do this by hand to avoid object existence check
427428
printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
428429
'

0 commit comments

Comments
 (0)