From: Junio C Hamano Date: Mon, 27 Aug 2018 21:33:45 +0000 (-0700) Subject: Merge branch 'sg/t4051-fix' X-Git-Tag: v2.19.0-rc1~12 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/603160b17e1884da3584dc5b424ecea4865c3d52?hp=-c Merge branch 'sg/t4051-fix' Test fixes. * sg/t4051-fix: t4051-diff-function-context: read the right file --- 603160b17e1884da3584dc5b424ecea4865c3d52 diff --combined t/t4051-diff-function-context.sh index 2d76a971c4,3df24f2ef2..4838a1df8b --- a/t/t4051-diff-function-context.sh +++ b/t/t4051-diff-function-context.sh @@@ -64,31 -64,11 +64,31 @@@ test_expect_success 'setup' grep -v "Begin of second part" file.c.new && mv file.c.new file.c && - commit_and_tag long_common_tail file.c + commit_and_tag long_common_tail file.c && + + git checkout initial && + cat "$dir/hello.c" "$dir/dummy.c" >file.c && + commit_and_tag hello_dummy file.c && + + # overlap function context of 1st change and -u context of 2nd change + grep -v "delete me from hello" <"$dir/hello.c" >file.c && + sed "2a\\ + extra line" <"$dir/dummy.c" >>file.c && + commit_and_tag changed_hello_dummy file.c && + + git checkout initial && + grep -v "delete me from hello" file.c.new && + mv file.c.new file.c && + cat "$dir/appended1.c" >>file.c && + commit_and_tag changed_hello_appended file.c ' check_diff changed_hello 'changed function' +test_expect_success ' context includes comment' ' + grep "^ .*Hello comment" changed_hello.diff +' + test_expect_success ' context includes begin' ' grep "^ .*Begin of hello" changed_hello.diff ' @@@ -105,7 -85,7 +105,7 @@@ test_expect_success ' context does not test "$(first_context_line