summaryrefslogtreecommitdiff
path: root/test-dump-cache-tree.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2014-07-07 17:33:43 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-08 10:35:11 -0700
commit969dd8c612b3b22c4080ffd4448cef4accbf428b (patch)
treeb99106d94dadef5aa476718b38e8aaecef6fc7e9 /test-dump-cache-tree.c
parentaecf567cbfb6ab46e82f7f5df36fb6a2dd5bee69 (diff)
downloadgit-969dd8c612b3b22c4080ffd4448cef4accbf428b.tar.gz
test-dump-cache-tree: invalid trees are not errors
Do not treat known-invalid trees as errors even when their subtree_nr is incorrect. Because git already knows that these trees are invalid, an incorrect subtree_nr will not cause problems. Add a couple of comments. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-dump-cache-tree.c')
-rw-r--r--test-dump-cache-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c
index 47eab9765f..cbbbd8e412 100644
--- a/test-dump-cache-tree.c
+++ b/test-dump-cache-tree.c
@@ -26,16 +26,16 @@ static int dump_cache_tree(struct cache_tree *it,
return 0;
if (it->entry_count < 0) {
+ /* invalid */
dump_one(it, pfx, "");
dump_one(ref, pfx, "#(ref) ");
- if (it->subtree_nr != ref->subtree_nr)
- errs = 1;
}
else {
dump_one(it, pfx, "");
if (hashcmp(it->sha1, ref->sha1) ||
ref->entry_count != it->entry_count ||
ref->subtree_nr != it->subtree_nr) {
+ /* claims to be valid but is lying */
dump_one(ref, pfx, "#(ref) ");
errs = 1;
}