diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-09-21 15:15:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-21 15:15:26 -0700 |
commit | 4ed38637ec6fa08b4bef42a35d87f95c0582b97b (patch) | |
tree | ebabad888f3f9af6cf34cbb45faa4dfc402bddcd /xdiff/xemit.c | |
parent | e9c6d3dcc2112f0d6190681211ea76b714fcd704 (diff) | |
parent | 45d2f75f913c0545be473db1dc2595a1600413f5 (diff) | |
download | git-4ed38637ec6fa08b4bef42a35d87f95c0582b97b.tar.gz |
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/xemit.c')
-rw-r--r-- | xdiff/xemit.c | 2 |
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; |