diff options
author | Jeff King <peff@peff.net> | 2019-04-10 05:13:25 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-10 06:59:39 +0300 |
commit | 97dd512af7ce4afb4f638ef73b4770921c8ca3aa (patch) | |
tree | cf6d9bf042b2f6ebac6779c99350e8bbcf6470d1 /t/t6102-rev-list-unexpected-objects.sh | |
parent | ee4dfee2274d2fd743066fa9fa4d37441ee522f8 (diff) |
rev-list: detect broken root trees
When the traversal machinery sees a commit without a root tree, it
assumes that the tree was part of a BOUNDARY commit, and quietly ignores
the tree. But it could also be caused by a commit whose root tree is
broken or missing.
Instead, let's die() when we see a NULL root tree. We can differentiate
it from the BOUNDARY case by seeing if the commit was actually parsed.
This covers that case, plus future-proofs us against any others where we
might try to show an unparsed commit.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6102-rev-list-unexpected-objects.sh')
-rwxr-xr-x | t/t6102-rev-list-unexpected-objects.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t6102-rev-list-unexpected-objects.sh b/t/t6102-rev-list-unexpected-objects.sh index 28ee1bcb07..28611c978e 100755 --- a/t/t6102-rev-list-unexpected-objects.sh +++ b/t/t6102-rev-list-unexpected-objects.sh @@ -67,8 +67,10 @@ test_expect_success 'traverse unexpected non-tree root (lone)' ' test_must_fail git rev-list --objects $broken_commit ' -test_expect_failure 'traverse unexpected non-tree root (seen)' ' - test_must_fail git rev-list --objects $blob $broken_commit +test_expect_success 'traverse unexpected non-tree root (seen)' ' + test_must_fail git rev-list --objects $blob $broken_commit \ + >output 2>&1 && + test_i18ngrep "not a tree" output ' test_expect_success 'setup unexpected non-commit tag' ' |