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>2017-11-18 21:08:08 +0300
committerJunio C Hamano <gitster@pobox.com>2017-11-21 03:36:06 +0300
commita5dc20b0701cee53b2c37a4aa3a339b48d5bb298 (patch)
treea77c5e843d10486bb70eea127cceadad419f159a /t/t7810-grep.sh
parent6653a01bf2dd1e2aabbcf1f83269bd75737acc94 (diff)
grep: show non-empty lines before functions with -W
Non-empty lines before a function definition are most likely comments for that function and thus relevant. Include them in function context. Such a non-empty line might also belong to the preceding function if there is no separating blank line. Stop extending the context upwards also at the next function line to make sure only one extra function body is shown at most. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 632b905611..c02ca735b9 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -785,7 +785,7 @@ test_expect_success 'grep -W with userdiff' '
git grep -W echo >function-context-userdiff-actual
'
-test_expect_failure ' includes preceding comment' '
+test_expect_success ' includes preceding comment' '
grep "# Say hello" function-context-userdiff-actual
'