rerere: report autoupdated paths only after actually updating them

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2015-06-28 21:13:24 -07:00
parent e2cb6a950b
commit a14c7ab8f5

View File

@ -482,6 +482,8 @@ static void update_paths(struct string_list *update)
struct string_list_item *item = &update->items[i]; struct string_list_item *item = &update->items[i];
if (add_file_to_cache(item->string, 0)) if (add_file_to_cache(item->string, 0))
exit(128); exit(128);
fprintf(stderr, "Staged '%s' using previous resolution.\n",
item->string);
} }
if (active_cache_changed) { if (active_cache_changed) {
@ -536,16 +538,16 @@ static int do_plain_rerere(struct string_list *rr, int fd)
const char *name = (const char *)rr->items[i].util; const char *name = (const char *)rr->items[i].util;
if (has_rerere_resolution(name)) { if (has_rerere_resolution(name)) {
if (!merge(name, path)) { if (merge(name, path))
const char *msg; continue;
if (rerere_autoupdate) {
string_list_insert(&update, path); if (rerere_autoupdate)
msg = "Staged '%s' using previous resolution.\n"; string_list_insert(&update, path);
} else else
msg = "Resolved '%s' using previous resolution.\n"; fprintf(stderr,
fprintf(stderr, msg, path); "Resolved '%s' using previous resolution.\n",
goto mark_resolved; path);
} goto mark_resolved;
} }
/* Let's see if we have resolved it. */ /* Let's see if we have resolved it. */