]> git.ipfire.org Git - thirdparty/git.git/commit
grep: -W: skip trailing empty lines at EOF, too
authorRené Scharfe <l.s.r@web.de>
Tue, 30 Jul 2024 14:18:54 +0000 (16:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jul 2024 16:59:04 +0000 (09:59 -0700)
commit8e5dd94e68e37d2d4b67e34db00b9e9790a2325b
tree94a6961f8769c7c4a9d968be2b31cdaecc98811d
parentc2b3f2b3cdbf5ad9feb978dd367d77561a1271f7
grep: -W: skip trailing empty lines at EOF, too

4aa2c4753d (grep: -W: don't extend context to trailing empty lines,
2016-05-28) stopped showing empty lines at the end of function context
when using -W.  Do the same for trailing empty lines at the end of
files, for consistency -- it doesn't matter whether a function section
is ended by the next function or the end of the file.

Test it by adding a trailing empty line to the file used by the test
"grep -W" and leave its expected output the same.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c
t/t7810-grep.sh