summaryrefslogtreecommitdiff
path: root/t/t1450-fsck.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-30 08:33:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-31 03:23:22 (GMT)
commit469e2ebf63cbf05455365aa3ed6d43acf6f4e496 (patch)
tree7bf97707210e0ecba44570c94cd35048c4df9266 /t/t1450-fsck.sh
parenta34a9dbbced36999496c52b43460825732d487ba (diff)
downloadgit-469e2ebf63cbf05455365aa3ed6d43acf6f4e496.zip
git-469e2ebf63cbf05455365aa3ed6d43acf6f4e496.tar.gz
git-469e2ebf63cbf05455365aa3ed6d43acf6f4e496.tar.bz2
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 0000000..d3a17b4
--- /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