summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-04 16:40:15 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-04 16:40:15 -0800
commit88ccb9f9745ff1f44bff7c6d6c17ad4b46870706 (patch)
tree856617bb64d0048e58b6408dc383f9302b85e935 /t
parent8aa7eebfb3383a32033a4af901142173ec87c830 (diff)
parente15ef669437d8396e0a442719ed54eb1df38366a (diff)
downloadgit-88ccb9f9745ff1f44bff7c6d6c17ad4b46870706.tar.gz
Merge branch 'jc/fsck' (early part)
* 'jc/fsck' (early part): fsck: check loose objects from alternate object stores by default fsck: HEAD is part of refs
Diffstat (limited to 't')
-rwxr-xr-xt/t1450-fsck.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
new file mode 100755
index 0000000000..4597af0eb6
--- /dev/null
+++ b/t/t1450-fsck.sh
@@ -0,0 +1,31 @@
+#!/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_expect_success 'loose objects borrowed from alternate are not missing' '
+ mkdir another &&
+ (
+ cd another &&
+ git init &&
+ echo ../../../.git/objects >.git/objects/info/alternates &&
+ test_commit C fileC one &&
+ git fsck >out &&
+ ! grep "missing blob" out
+ )
+'
+
+test_done