diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-11 11:03:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-11 11:03:09 -0700 |
commit | 5fb249aec763205f8d26370a18c5adb167008dd8 (patch) | |
tree | d3fcf60ccad806d032855dcb390992071a7f5dea /t | |
parent | 1c1b7eed5c7fc6ca397eab006be67646c9f599d7 (diff) | |
parent | 317f63c21c8eac46813eacf487485445f2f79a6d (diff) | |
download | git-5fb249aec763205f8d26370a18c5adb167008dd8.tar.gz |
Merge branch 'rs/grep-function-context'
* rs/grep-function-context:
grep: long context options
grep: add option to show whole function as context
Diffstat (limited to 't')
-rwxr-xr-x | t/t7810-grep.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index a29ae45b39..0d600163c8 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -509,6 +509,20 @@ test_expect_success 'grep -p -B5' ' test_cmp expected actual ' +cat >expected <<EOF +hello.c=int main(int argc, const char **argv) +hello.c-{ +hello.c- printf("Hello world.\n"); +hello.c: return 0; +hello.c- /* char ?? */ +hello.c-} +EOF + +test_expect_success 'grep -W' ' + git grep -W return >actual && + test_cmp expected actual +' + test_expect_success 'grep from a subdirectory to search wider area (1)' ' mkdir -p s && ( |