Git fork

t4051: add test for comments preceding function lines

When showing function context it would be helpful to show comments
immediately before declarations, as they are most likely relevant.

Add a test for that, but without specifying the choice of lines too
rigidly in the test---we may want to stop before and not include
"/*" in the future, for example.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

René Scharfe and committed by
Junio C Hamano
eced93bc 89ea799f

+7
+4
t/t4051-diff-function-context.sh
··· 85 85 86 86 check_diff changed_hello 'changed function' 87 87 88 + test_expect_failure ' context includes comment' ' 89 + grep "^ .*Hello comment" changed_hello.diff 90 + ' 91 + 88 92 test_expect_success ' context includes begin' ' 89 93 grep "^ .*Begin of hello" changed_hello.diff 90 94 '
+3
t/t4051/hello.c
··· 1 1 2 + /* 3 + * Hello comment. 4 + */ 2 5 static void hello(void) // Begin of hello 3 6 { 4 7 /*