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:03:16 +0300
committerJunio C Hamano <gitster@pobox.com>2016-05-31 23:08:56 +0300
commit9e6a4cfc38aa81055d0b7d6fb94dc7b31809daa9 (patch)
treee03053b418d6223b8fa33714e43037e5ba7524b5 /t/t4051-diff-function-context.sh
parent392f6d316623e8ecd6210248ba9ae2cabf07352b (diff)
xdiff: -W: don't include common trailing empty lines in context
Empty lines between functions are shown by diff -W, as it considers them to be part of the function preceding them. They are not interesting in most languages. The previous patch stopped showing them in the special case of a function added at the end of a file. Stop extending context to those empty lines by skipping back over them from the start of the next function. 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.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index f7126fc245..17616fe582 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -85,7 +85,7 @@ test_expect_success ' context does not include preceding empty lines' '
test "$(first_context_line <changed_hello.diff)" != " "
'
-test_expect_failure ' context does not include trailing empty lines' '
+test_expect_success ' context does not include trailing empty lines' '
test "$(last_context_line <changed_hello.diff)" != " "
'
@@ -103,7 +103,7 @@ test_expect_success ' context does not include other functions' '
test $(grep -c "^[ +-].*Begin" changed_includes.diff) -le 1
'
-test_expect_failure ' context does not include trailing empty lines' '
+test_expect_success ' context does not include trailing empty lines' '
test "$(last_context_line <changed_includes.diff)" != " "
'