summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-21 22:15:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-21 22:15:26 (GMT)
commit4ed38637ec6fa08b4bef42a35d87f95c0582b97b (patch)
treeebabad888f3f9af6cf34cbb45faa4dfc402bddcd /xdiff
parente9c6d3dcc2112f0d6190681211ea76b714fcd704 (diff)
parent45d2f75f913c0545be473db1dc2595a1600413f5 (diff)
downloadgit-4ed38637ec6fa08b4bef42a35d87f95c0582b97b.zip
git-4ed38637ec6fa08b4bef42a35d87f95c0582b97b.tar.gz
git-4ed38637ec6fa08b4bef42a35d87f95c0582b97b.tar.bz2
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 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;