diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:44 -0700 |
| commit | 87ece7ce1133ebc5d339cad5f6f92c02e5fc712d (patch) | |
| tree | 80a92c51969d8893f56b74a595ab9c260cca1091 /t/t7810-grep.sh | |
| parent | 562413eb2938b7a1aa85a2ae157ef162d51e55dc (diff) | |
| parent | 9d8db06eb4a5d5577db559a0059a377914c1ce5a (diff) | |
| download | git-87ece7ce1133ebc5d339cad5f6f92c02e5fc712d.tar.gz | |
Merge branch 'tb/grep-only-matching'
"git grep" learned the "--only-matching" option.
* tb/grep-only-matching:
grep.c: teach 'git grep --only-matching'
grep.c: extract show_line_header()
Diffstat (limited to 't/t7810-grep.sh')
| -rwxr-xr-x | t/t7810-grep.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 90bba4fcef..dcaab1557b 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -262,6 +262,21 @@ do fi ' + test_expect_success "grep $L (with --column, --only-matching)" ' + { + echo ${HC}file:1:5:mmap + echo ${HC}file:2:5:mmap + echo ${HC}file:3:5:mmap + echo ${HC}file:3:13:mmap + echo ${HC}file:4:5:mmap + echo ${HC}file:4:13:mmap + echo ${HC}file:5:5:mmap + echo ${HC}file:5:13:mmap + } >expected && + git grep --column -n -o -e mmap $H >actual && + test_cmp expected actual + ' + test_expect_success "grep $L (t-1)" ' echo "${HC}t/t:1:test" >expected && git grep -n -e test $H >actual && |
