@matheusbsbs / matheus-bagliano / commits / b05c6dff8a
Fork 0

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 <barkalow@iabervon.org>

Daniel Barkalow committed Feb 7, 2008 at 11:39 UTC b05c6dff8aa8af5a03717e8d863b911cede213a0
1 file changed +7 -7
unpack-trees.c
+7 -7
@@ -122,13 +122,13 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
122
123 #if DBRT_DEBUG > 1
124 if (first)
125 - printf("index %s\n", first);
125 + fprintf(stderr, "index %s\n", first);
126 #endif
127 for (i = 0; i < len; i++) {
128 if (!posns[i] || posns[i] == df_conflict_list)
129 continue;
130 #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);
132 #endif
133 if (!first || entcmp(first, firstdir,
134 posns[i]->name,
@@ -209,13 +209,13 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
209 int ret;
210
211 #if DBRT_DEBUG > 1
212 - printf("%s:\n", first);
212 + fprintf(stderr, "%s:\n", first);
213 for (i = 0; i < src_size; i++) {
214 - printf(" %d ", i);
214 + fprintf(stderr, " %d ", i);
215 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));
217 else
218 - printf("\n");
218 + fprintf(stderr, "\n");
219 }
220 #endif
221 ret = o->fn(src, o, remove);
@@ -223,7 +223,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
223 return ret;
224
225 #if DBRT_DEBUG > 1
226 - printf("Added %d entries\n", ret);
226 + fprintf(stderr, "Added %d entries\n", ret);
227 #endif
228 o->pos += ret;
229 } else {