Skip to content

Commit b05c6df

Browse files
iabervongitster
authored andcommitted
Send unpack-trees debugging output to stderr
This is to keep git-stash from getting confused if you're debugging unpack-trees. Signed-off-by: Daniel Barkalow <[email protected]>
1 parent 17e4642 commit b05c6df

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

unpack-trees.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
122122

123123
#if DBRT_DEBUG > 1
124124
if (first)
125-
printf("index %s\n", first);
125+
fprintf(stderr, "index %s\n", first);
126126
#endif
127127
for (i = 0; i < len; i++) {
128128
if (!posns[i] || posns[i] == df_conflict_list)
129129
continue;
130130
#if DBRT_DEBUG > 1
131-
printf("%d %s\n", i + 1, posns[i]->name);
131+
fprintf(stderr, "%d %s\n", i + 1, posns[i]->name);
132132
#endif
133133
if (!first || entcmp(first, firstdir,
134134
posns[i]->name,
@@ -209,21 +209,21 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
209209
int ret;
210210

211211
#if DBRT_DEBUG > 1
212-
printf("%s:\n", first);
212+
fprintf(stderr, "%s:\n", first);
213213
for (i = 0; i < src_size; i++) {
214-
printf(" %d ", i);
214+
fprintf(stderr, " %d ", i);
215215
if (src[i])
216-
printf("%s\n", sha1_to_hex(src[i]->sha1));
216+
fprintf(stderr, "%06x %s\n", src[i]->ce_mode, sha1_to_hex(src[i]->sha1));
217217
else
218-
printf("\n");
218+
fprintf(stderr, "\n");
219219
}
220220
#endif
221221
ret = o->fn(src, o, remove);
222222
if (ret < 0)
223223
return ret;
224224

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

0 commit comments

Comments
 (0)