diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-11-02 11:46:49 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-03 02:37:06 +0300 |
commit | 239371168173da9a9556617fced1e053ac618a85 (patch) | |
tree | a1477b7e865be87a040c01be3cf5eaadfb699432 /t/t1450-fsck.sh | |
parent | 1c6667cb9dab6f90dcc3381676b50b1f131aeda5 (diff) |
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>
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-x | t/t1450-fsck.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index f55b539b08..a3c97b9c7f 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -133,7 +133,7 @@ test_expect_success 'HEAD link pointing at a funny object' ' test_expect_success 'HEAD link pointing at a funny place' ' test_when_finished "git update-ref --no-deref HEAD $orig_head" && - echo "ref: refs/funny/place" >.git/HEAD && + test-tool ref-store main create-symref HEAD refs/funny/place && # avoid corrupt/broken HEAD from interfering with repo discovery test_must_fail env GIT_DIR=.git git fsck 2>out && test_i18ngrep "HEAD points to something strange" out @@ -169,7 +169,7 @@ test_expect_success 'other worktree HEAD link pointing at missing object' ' test_expect_success 'other worktree HEAD link pointing at a funny place' ' test_when_finished "rm -rf .git/worktrees other" && git worktree add other && - echo "ref: refs/funny/place" >.git/worktrees/other/HEAD && + git -C other symbolic-ref HEAD refs/funny/place && test_must_fail git fsck 2>out && test_i18ngrep "worktrees/other/HEAD points to something strange" out ' |