SHA256
3
0
forked from pool/patch
patch/diff3-style-merges-other-strategy.diff

37 lines
888 B
Diff

---
patch.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: b/patch.c
===================================================================
--- a/patch.c
+++ b/patch.c
@@ -1459,6 +1459,18 @@ static bool merge_hunk (struct outstate
R_merge_end--;
}
} else {
+#if 1
+ /* Hide common suffix context */
+ R_merge_end = where + lastline - 1;
+ while (old <= lastline && new <= pat_end) {
+ if (!common_context(R_merge_end, lastline, pat_end))
+ break;
+ lastline--;
+ pat_end--;
+ R_merge_end--;
+ }
+ R_merge_end = merge - 1;
+#else
LINENUM overlap = pch_suffix_context ();
/* Hide common suffix context: check how much overlap we have! */
@@ -1482,6 +1494,8 @@ static bool merge_hunk (struct outstate
pat_end += n;
overlap--;
}
+ /*assert(R_merge_end == merge - 1);*/
+#endif
}
assert (outstate->after_newline);