t: convert tests to not access symrefs via the filesystem

Some of our tests access symbolic references via the filesystem
directly. While this works with the current files reference backend, it
this will break once we have a second reference backend in our codebase.

Refactor these tests to instead use git-symbolic-ref(1) or our
`ref-store` test tool. The latter is required in some cases where safety
checks of git-symbolic-ref(1) would otherwise reject writing a symbolic
reference.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2023-11-02 09:46:49 +01:00
committed by Junio C Hamano
parent 1c6667cb9d
commit 2393711681
9 changed files with 40 additions and 25 deletions

View File

@ -11,7 +11,7 @@ test_expect_success 'setup repo with a git repo inside it' '
(
cd s &&
git init &&
test -f .git/HEAD &&
git symbolic-ref HEAD &&
> .git/a &&
echo a > a &&
svn_cmd add .git a &&