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>
This commit is contained in:

committed by
Junio C Hamano

parent
af4c62ae88
commit
c41dd2fd7d
@ -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
|
||||
--
|
||||
|
Reference in New Issue
Block a user