Skip to content

Commit

Permalink
read-tree: fix bogus debugging statement.
Browse files Browse the repository at this point in the history
We wanted to detect case #16 which should be rare, but botched the
case when some paths are missing, causing a segfault.  My fault.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 14, 2005
1 parent 74376a6 commit 2ba6c47
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,15 @@ static int keep_entry(struct cache_entry *ce)
static void show_stage_entry(FILE *o,
const char *label, const struct cache_entry *ce)
{
fprintf(stderr, "%s%06o %s %d\t%s\n",
label,
ntohl(ce->ce_mode),
sha1_to_hex(ce->sha1),
ce_stage(ce),
ce->name);
if (!ce)
fprintf(o, "%s (missing)\n", label);
else
fprintf(o, "%s%06o %s %d\t%s\n",
label,
ntohl(ce->ce_mode),
sha1_to_hex(ce->sha1),
ce_stage(ce),
ce->name);
}
#endif

Expand Down

0 comments on commit 2ba6c47

Please sign in to comment.