aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-01-12 10:03:05 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-12 06:55:41 -0800
commit9727336b31c055e4507248703b8a4a8ed039dc06 (patch)
tree5833f6aa7d7609de428745188d3c4eba40517534 /t
parent46d611cadab500ca2b458b2fda7008c41b174011 (diff)
downloadgit-9727336b31c055e4507248703b8a4a8ed039dc06.tar.xz
builtin/fsck: move generic HEAD check into `refs_fsck()`
Move the check that detects "HEAD" refs that do not point at a branch into `refs_fsck()`. This follows the same motivation as the preceding commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t0602-reffiles-fsck.sh8
-rwxr-xr-xt/t1450-fsck.sh4
2 files changed, 6 insertions, 6 deletions
diff --git a/t/t0602-reffiles-fsck.sh b/t/t0602-reffiles-fsck.sh
index 479f3d528e..3c1f553b81 100755
--- a/t/t0602-reffiles-fsck.sh
+++ b/t/t0602-reffiles-fsck.sh
@@ -910,10 +910,10 @@ test_expect_success 'complains about broken root ref' '
git init repo &&
(
cd repo &&
- echo "ref: refs/../HEAD" >.git/HEAD &&
+ echo "ref: refs/heads/../HEAD" >.git/HEAD &&
test_must_fail git refs verify 2>err &&
cat >expect <<-EOF &&
- error: HEAD: badReferentName: points to invalid refname ${SQ}refs/../HEAD${SQ}
+ error: HEAD: badReferentName: points to invalid refname ${SQ}refs/heads/../HEAD${SQ}
EOF
test_cmp expect err
)
@@ -926,10 +926,10 @@ test_expect_success 'complains about broken root ref in worktree' '
cd repo &&
test_commit initial &&
git worktree add ../worktree &&
- echo "ref: refs/../HEAD" >.git/worktrees/worktree/HEAD &&
+ echo "ref: refs/heads/../HEAD" >.git/worktrees/worktree/HEAD &&
test_must_fail git refs verify 2>err &&
cat >expect <<-EOF &&
- error: worktrees/worktree/HEAD: badReferentName: points to invalid refname ${SQ}refs/../HEAD${SQ}
+ error: worktrees/worktree/HEAD: badReferentName: points to invalid refname ${SQ}refs/heads/../HEAD${SQ}
EOF
test_cmp expect err
)
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 900c1b2eb2..3fae05f9d9 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -113,7 +113,7 @@ test_expect_success 'HEAD link pointing at a funny place' '
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_grep "HEAD points to something strange" out
+ test_grep "HEAD: badHeadTarget: HEAD points to non-branch ${SQ}refs/funny/place${SQ}" out
'
test_expect_success REFFILES 'HEAD link pointing at a funny object (from different wt)' '
@@ -148,7 +148,7 @@ test_expect_success 'other worktree HEAD link pointing at a funny place' '
git worktree add other &&
git -C other symbolic-ref HEAD refs/funny/place &&
test_must_fail git fsck 2>out &&
- test_grep "worktrees/other/HEAD points to something strange" out
+ test_grep "worktrees/other/HEAD: badHeadTarget: HEAD points to non-branch ${SQ}refs/funny/place${SQ}" out
'
test_expect_success 'commit with multiple signatures is okay' '