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:
authorRené Scharfe <l.s.r@web.de>2016-05-28 18:02:24 +0300
committerJunio C Hamano <gitster@pobox.com>2016-05-31 23:08:56 +0300
commit392f6d316623e8ecd6210248ba9ae2cabf07352b (patch)
tree1991158ad53833e30253d96de495625b9173cf80 /t/t4051-diff-function-context.sh
parent6d5badb2389d5d1d0752a230cd7ee74bb4043893 (diff)
xdiff: ignore empty lines before added functions with -W
If a new function and a preceding empty line is appended, diff -W shows the previous function in full in order to provide context for that empty line. In most languages empty lines between sections are not interesting in and off themselves and showing a whole extra function for them is not what we want. Skip empty lines when checking of the appended chunk starts with a function line, thereby avoiding to extend the context just for them. Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4051-diff-function-context.sh')
-rwxr-xr-xt/t4051-diff-function-context.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index 4cff119b69..f7126fc245 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -117,7 +117,7 @@ test_expect_success ' context includes end' '
grep "^[+].*End of first part" appended.diff
'
-test_expect_failure ' context does not include other functions' '
+test_expect_success ' context does not include other functions' '
test $(grep -c "^[ +-].*Begin" appended.diff) -le 1
'