aboutsummaryrefslogtreecommitdiff
path: root/t/t1450-fsck.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-30 00:33:00 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-30 19:23:22 -0800
commit469e2ebf63cbf05455365aa3ed6d43acf6f4e496 (patch)
tree7bf97707210e0ecba44570c94cd35048c4df9266 /t/t1450-fsck.sh
parenta34a9dbbced36999496c52b43460825732d487ba (diff)
downloadgit-469e2ebf63cbf05455365aa3ed6d43acf6f4e496.tar.gz
git-469e2ebf63cbf05455365aa3ed6d43acf6f4e496.tar.xz
fsck: HEAD is part of refs
By default we looked at all refs but not HEAD. The only thing that made fsck not lose sight of commits that are only reachable from a detached HEAD was the reflog for the HEAD. This fixes it, with a new test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-xt/t1450-fsck.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
new file mode 100755
index 000000000..d3a17b450
--- /dev/null
+++ b/t/t1450-fsck.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+test_description='git fsck random collection of tests'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ test_commit A fileA one &&
+ git checkout HEAD^0 &&
+ test_commit B fileB two &&
+ git tag -d A B &&
+ git reflog expire --expire=now --all
+'
+
+test_expect_success 'HEAD is part of refs' '
+ test 0 = $(git fsck | wc -l)
+'
+
+test_done