summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-03-20 06:16:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-20 06:16:06 (GMT)
commitea327760d38b03be552418de044843cd2f0dba2e (patch)
tree3c8413ae4d0c5728712332169495b96560438aef /t
parent88255bba4518c02d8eb9678d7358175158a1d7cb (diff)
parent8d8c2a5aef0fd20a68271697e50412791c06d9b7 (diff)
downloadgit-ea327760d38b03be552418de044843cd2f0dba2e.zip
git-ea327760d38b03be552418de044843cd2f0dba2e.tar.gz
git-ea327760d38b03be552418de044843cd2f0dba2e.tar.bz2
Merge branch 'jk/fsck-doc'
"git fsck --connectivity-only" omits computation necessary to sift the objects that are not reachable from any of the refs into unreachable and dangling. This is now enabled when dangling objects are requested (which is done by default, but can be overridden with the "--no-dangling" option). * jk/fsck-doc: fsck: always compute USED flags for unreachable objects doc/fsck: clarify --connectivity-only behavior
Diffstat (limited to 't')
-rwxr-xr-xt/t1450-fsck.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index c61f972..49f08d5 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -740,7 +740,7 @@ test_expect_success 'fsck detects truncated loose object' '
# for each of type, we have one version which is referenced by another object
# (and so while unreachable, not dangling), and another variant which really is
# dangling.
-test_expect_success 'fsck notices dangling objects' '
+test_expect_success 'create dangling-object repository' '
git init dangling &&
(
cd dangling &&
@@ -751,12 +751,17 @@ test_expect_success 'fsck notices dangling objects' '
commit=$(git commit-tree $tree) &&
dcommit=$(git commit-tree -p $commit $tree) &&
- cat >expect <<-EOF &&
+ cat >expect <<-EOF
dangling blob $dblob
dangling commit $dcommit
dangling tree $dtree
EOF
+ )
+'
+test_expect_success 'fsck notices dangling objects' '
+ (
+ cd dangling &&
git fsck >actual &&
# the output order is non-deterministic, as it comes from a hash
sort <actual >actual.sorted &&
@@ -764,6 +769,16 @@ test_expect_success 'fsck notices dangling objects' '
)
'
+test_expect_success 'fsck --connectivity-only notices dangling objects' '
+ (
+ cd dangling &&
+ git fsck --connectivity-only >actual &&
+ # the output order is non-deterministic, as it comes from a hash
+ sort <actual >actual.sorted &&
+ test_i18ncmp expect actual.sorted
+ )
+'
+
test_expect_success 'fsck $name notices bogus $name' '
test_must_fail git fsck bogus &&
test_must_fail git fsck $ZERO_OID