summaryrefslogtreecommitdiff
path: root/t/t7810-grep.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-03-19 19:33:15 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-19 21:46:52 -0700
commitc41dd2fd7d3a16e6f0b1629d688bee3240db496c (patch)
tree77348580064caf5b871624a98f007450627bb42d /t/t7810-grep.sh
parentaf4c62ae88d403a417ba7c2b879eca10e7bff8f4 (diff)
downloadgit-c41dd2fd7d3a16e6f0b1629d688bee3240db496c.tar.gz
grep: read patterns from stdin with -f -
Support the well-know convention of reading standard input instead of a named file if "-" (dash) is specified. GNU grep does the same. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 8a7788dc39..dbc6cd8a77 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -303,6 +303,11 @@ test_expect_success 'grep -f, ignore empty lines' '
test_cmp expected actual
'
+test_expect_success 'grep -f, ignore empty lines, read patterns from stdin' '
+ git grep -f - <patterns >actual &&
+ test_cmp expected actual
+'
+
cat >expected <<EOF
y:y yy
--