about summary refs log tree commit diff
path: root/third_party/git/diffcore-break.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/diffcore-break.c')
-rw-r--r--third_party/git/diffcore-break.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/third_party/git/diffcore-break.c b/third_party/git/diffcore-break.c
index 9d20a6a6fc..875aefd3fe 100644
--- a/third_party/git/diffcore-break.c
+++ b/third_party/git/diffcore-break.c
@@ -286,17 +286,17 @@ void diffcore_merge_broken(void)
 					/* Peer survived.  Merge them */
 					merge_broken(p, pp, &outq);
 					q->queue[j] = NULL;
-					goto next;
+					break;
 				}
 			}
-			/* The peer did not survive, so we keep
-			 * it in the output.
-			 */
-			diff_q(&outq, p);
+			if (q->nr <= j)
+				/* The peer did not survive, so we keep
+				 * it in the output.
+				 */
+				diff_q(&outq, p);
 		}
 		else
 			diff_q(&outq, p);
-next:;
 	}
 	free(q->queue);
 	*q = outq;