summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-09-21 15:15:26 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-21 15:15:26 -0700
commit4ed38637ec6fa08b4bef42a35d87f95c0582b97b (patch)
treeebabad888f3f9af6cf34cbb45faa4dfc402bddcd /xdiff
parentMerge branch 'rs/unpack-trees-reduce-file-scope-global' (diff)
parentxdiff: fix merging of hunks with -W context and -u context (diff)
downloadtgif-4ed38637ec6fa08b4bef42a35d87f95c0582b97b.tar.xz
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context'
"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 b52b4b9c1e..7389ce4102 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;