Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-28 00:57:17 +0300
committerJunio C Hamano <gitster@pobox.com>2017-02-28 00:57:17 +0300
commit9720b302479639253518d39ec758241d91275ee6 (patch)
tree65ad628490b752d0f33009becd4fde1f71a9a591
parent39b8980bb9eacfff0f28101e71354350fdfc5340 (diff)
parent540d3eb0ebad425f0902cbca0549288fe627f058 (diff)
Merge branch 'vn/xdiff-func-context'
"git diff -W" has been taught to handle the case where a new function is added at the end of the file better. * vn/xdiff-func-context: xdiff -W: relax end-of-file function detection
-rw-r--r--xdiff/xemit.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 7389ce4102..8c88dbde38 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -183,16 +183,14 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
/*
* We don't need additional context if
- * a whole function was added, possibly
- * starting with empty lines.
+ * a whole function was added.
*/
- while (i2 < xe->xdf2.nrec &&
- is_empty_rec(&xe->xdf2, i2))
+ while (i2 < xe->xdf2.nrec) {
+ if (match_func_rec(&xe->xdf2, xecfg, i2,
+ dummy, sizeof(dummy)) >= 0)
+ goto post_context_calculation;
i2++;
- if (i2 < xe->xdf2.nrec &&
- match_func_rec(&xe->xdf2, xecfg, i2,
- dummy, sizeof(dummy)) >= 0)
- goto post_context_calculation;
+ }
/*
* Otherwise get more context from the