summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-28 21:13:24 -0700
committerJunio C Hamano <gitster@pobox.com>2015-07-24 15:08:44 -0700
commita14c7ab8f58f3b2aea99e65a74c9f9ab4f955a40 (patch)
tree8263412c6105f15a63832b416c20e6b24e7e63d9 /rerere.c
parente2cb6a950b4617edc3d07b372063b624b2b5c420 (diff)
downloadgit-a14c7ab8f58f3b2aea99e65a74c9f9ab4f955a40.tar.gz
rerere: report autoupdated paths only after actually updating them
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/rerere.c b/rerere.c
index d8518a450f..7fa58cc8b2 100644
--- a/rerere.c
+++ b/rerere.c
@@ -482,6 +482,8 @@ static void update_paths(struct string_list *update)
struct string_list_item *item = &update->items[i];
if (add_file_to_cache(item->string, 0))
exit(128);
+ fprintf(stderr, "Staged '%s' using previous resolution.\n",
+ item->string);
}
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;
if (has_rerere_resolution(name)) {
- if (!merge(name, path)) {
- const char *msg;
- if (rerere_autoupdate) {
- string_list_insert(&update, path);
- msg = "Staged '%s' using previous resolution.\n";
- } else
- msg = "Resolved '%s' using previous resolution.\n";
- fprintf(stderr, msg, path);
- goto mark_resolved;
- }
+ if (merge(name, path))
+ continue;
+
+ if (rerere_autoupdate)
+ string_list_insert(&update, path);
+ else
+ fprintf(stderr,
+ "Resolved '%s' using previous resolution.\n",
+ path);
+ goto mark_resolved;
}
/* Let's see if we have resolved it. */