Code

Fix test-dump-cache-tree in one-tree disappeared case.
authorJunio C Hamano <junkio@cox.net>
Wed, 3 May 2006 22:32:54 +0000 (15:32 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 3 May 2006 22:33:32 +0000 (15:33 -0700)
When reconstructing an invalidated subtree for reference purposes by
test-dump-cache-tree, we did not handle the case where we shouldn't
have a cached and invalidated subtree in the result, leading to an
unneeded die().

Signed-off-by: Junio C Hamano <junkio@cox.net>
dump-cache-tree.c

index fbea263dd9a37726f7b9e29154d56b26cfe921c2..1ccaf5177318f8765205e192abdffc3336c9aacb 100644 (file)
@@ -21,10 +21,9 @@ static int dump_cache_tree(struct cache_tree *it,
        int i;
        int errs = 0;
 
-       if (!it)
-               return;
-       if (!ref)
-               die("internal error");
+       if (!it || !ref)
+               /* missing in either */
+               return 0;
 
        if (it->entry_count < 0) {
                dump_one(it, pfx, "");