Skip to content

Commit 969dd8c

Browse files
dturner-twgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aecf567 commit 969dd8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-dump-cache-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ static int dump_cache_tree(struct cache_tree *it,
2626
return 0;
2727

2828
if (it->entry_count < 0) {
29+
/* invalid */
2930
dump_one(it, pfx, "");
3031
dump_one(ref, pfx, "#(ref) ");
31-
if (it->subtree_nr != ref->subtree_nr)
32-
errs = 1;
3332
}
3433
else {
3534
dump_one(it, pfx, "");
3635
if (hashcmp(it->sha1, ref->sha1) ||
3736
ref->entry_count != it->entry_count ||
3837
ref->subtree_nr != it->subtree_nr) {
38+
/* claims to be valid but is lying */
3939
dump_one(ref, pfx, "#(ref) ");
4040
errs = 1;
4141
}

0 commit comments

Comments
 (0)