summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-29 23:49:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-29 23:49:39 (GMT)
commitef4f0cad4ba2340d02e79f60a5b5a308048222c7 (patch)
tree17ff9af698e5d38d17e9cc7d06e46ad0413f1f9a /xdiff
parente007a094d49d58105a93a22bd4e6d33f6b3eacbd (diff)
parent45d2f75f913c0545be473db1dc2595a1600413f5 (diff)
downloadgit-ef4f0cad4ba2340d02e79f60a5b5a308048222c7.zip
git-ef4f0cad4ba2340d02e79f60a5b5a308048222c7.tar.gz
git-ef4f0cad4ba2340d02e79f60a5b5a308048222c7.tar.bz2
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint
"git diff -W" output needs to extend the context backward to include the header line of the current function and also forward to include the body of the entire current function up to the header line of the next one. This process may have to merge to adjacent hunks, but the code forgot to do so in some cases. * rs/xdiff-merge-overlapping-hunks-for-W-context: xdiff: fix merging of hunks with -W context and -u context
Diffstat (limited to 'xdiff')
-rw-r--r--xdiff/xemit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index b52b4b9..7389ce4 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -239,7 +239,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
if (xche->next) {
long l = XDL_MIN(xche->next->i1,
xe->xdf1.nrec - 1);
- if (l <= e1 ||
+ if (l - xecfg->ctxlen <= e1 ||
get_func_line(xe, xecfg, NULL, l, e1) < 0) {
xche = xche->next;
goto post_context_calculation;