aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-11 11:03:09 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-11 11:03:09 -0700
commit5fb249aec763205f8d26370a18c5adb167008dd8 (patch)
treed3fcf60ccad806d032855dcb390992071a7f5dea /t
parent1c1b7eed5c7fc6ca397eab006be67646c9f599d7 (diff)
parent317f63c21c8eac46813eacf487485445f2f79a6d (diff)
downloadgit-5fb249aec763205f8d26370a18c5adb167008dd8.tar.gz
git-5fb249aec763205f8d26370a18c5adb167008dd8.tar.xz
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-xt/t7810-grep.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index a29ae45b3..0d600163c 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 &&
(