rerere: handle conflicts with multiple stage #1 entries
authorJunio C Hamano <gitster@pobox.com>
Fri, 24 Jul 2015 22:08:03 +0000 (15:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Jul 2015 22:08:05 +0000 (15:08 -0700)
A conflicted index can have multiple stage #1 entries when dealing
with a criss-cross merge and using the "resolve" merge strategy.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c
index e307711f817a9e599d2a597e59d1c87be2fb7eed..b453a80085a016a08417111b60bd847ea2b3c742 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -369,7 +369,7 @@ static int check_one_conflict(int i, int *type)
        }
 
        *type = PUNTED;
-       if (ce_stage(e) == 1)
+       while (ce_stage(active_cache[i]) == 1)
                i++;
 
        /* Only handle regular files with both stages #2 and #3 */