Skip to content

Commit

Permalink
Send unpack-trees debugging output to stderr
Browse files Browse the repository at this point in the history
This is to keep git-stash from getting confused if you're debugging
unpack-trees.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
  • Loading branch information
Daniel Barkalow authored and Junio C Hamano committed Feb 10, 2008
1 parent 17e4642 commit b05c6df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,

#if DBRT_DEBUG > 1
if (first)
printf("index %s\n", first);
fprintf(stderr, "index %s\n", first);
#endif
for (i = 0; i < len; i++) {
if (!posns[i] || posns[i] == df_conflict_list)
continue;
#if DBRT_DEBUG > 1
printf("%d %s\n", i + 1, posns[i]->name);
fprintf(stderr, "%d %s\n", i + 1, posns[i]->name);
#endif
if (!first || entcmp(first, firstdir,
posns[i]->name,
Expand Down Expand Up @@ -209,21 +209,21 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
int ret;

#if DBRT_DEBUG > 1
printf("%s:\n", first);
fprintf(stderr, "%s:\n", first);
for (i = 0; i < src_size; i++) {
printf(" %d ", i);
fprintf(stderr, " %d ", i);
if (src[i])
printf("%s\n", sha1_to_hex(src[i]->sha1));
fprintf(stderr, "%06x %s\n", src[i]->ce_mode, sha1_to_hex(src[i]->sha1));
else
printf("\n");
fprintf(stderr, "\n");
}
#endif
ret = o->fn(src, o, remove);
if (ret < 0)
return ret;

#if DBRT_DEBUG > 1
printf("Added %d entries\n", ret);
fprintf(stderr, "Added %d entries\n", ret);
#endif
o->pos += ret;
} else {
Expand Down

0 comments on commit b05c6df

Please sign in to comment.