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>
David Turner committed
Jul 7, 2014 at 17:33 UTC
969dd8c612b3b22c4080ffd4448cef4accbf428b
1 file changed
+2
-2
test-dump-cache-tree.c
+2
-2
@@ -26,16 +26,16 @@ static int dump_cache_tree(struct cache_tree *it,
26
return 0;
27
28
if (it->entry_count < 0) {
29
+ /* invalid */
30
dump_one(it, pfx, "");
31
dump_one(ref, pfx, "#(ref) ");
31
- if (it->subtree_nr != ref->subtree_nr)
32
- errs = 1;
32
}
33
else {
34
dump_one(it, pfx, "");
35
if (hashcmp(it->sha1, ref->sha1) ||
36
ref->entry_count != it->entry_count ||
37
ref->subtree_nr != it->subtree_nr) {
38
+ /* claims to be valid but is lying */
39
dump_one(ref, pfx, "#(ref) ");
40
errs = 1;
41
}