diff options
author | René Scharfe <l.s.r@web.de> | 2017-11-18 19:08:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-21 09:36:06 +0900 |
commit | a5dc20b0701cee53b2c37a4aa3a339b48d5bb298 (patch) | |
tree | a77c5e843d10486bb70eea127cceadad419f159a /t | |
parent | grep: update boundary variable for pre-context (diff) | |
download | tgif-a5dc20b0701cee53b2c37a4aa3a339b48d5bb298.tar.xz |
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')
-rwxr-xr-x | t/t7810-grep.sh | 2 |
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 ' |