From a84faf777075e54f9faf22dbc6345fd756cd0c8d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 3 May 2006 15:32:54 -0700 Subject: [PATCH] Fix test-dump-cache-tree in one-tree disappeared case. 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 --- dump-cache-tree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dump-cache-tree.c b/dump-cache-tree.c index fbea263d..1ccaf517 100644 --- a/dump-cache-tree.c +++ b/dump-cache-tree.c @@ -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, ""); -- 2.11.0