From: Junio C Hamano Date: Wed, 29 Sep 2010 20:49:57 +0000 (-0700) Subject: Merge branch 'jc/grep-header-all-match-fix' X-Git-Tag: v1.7.4-rc0~199 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a27d5bef56d0689873b29236addf4f7879e974ec?ds=inline;hp=-c Merge branch 'jc/grep-header-all-match-fix' * jc/grep-header-all-match-fix: log --author: take union of multiple "author" requests grep: move logic to compile header pattern into a separate helper --- a27d5bef56d0689873b29236addf4f7879e974ec diff --combined t/t7810-grep.sh index 023f225a4b,dc5c08548b..50658845ca --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@@ -65,7 -65,7 +65,7 @@@ d test_expect_success "grep -w $L (w)" ' : >expected && - ! git grep -n -w -e "^w" >actual && + test_must_fail git grep -n -w -e "^w" >actual && test_cmp expected actual ' @@@ -324,8 -324,13 +324,13 @@@ test_expect_success 'log grep setup' echo a >>file && test_tick && - git commit -a -m "third" + git commit -a -m "third" && + echo a >>file && + test_tick && + GIT_AUTHOR_NAME="Night Fall" \ + GIT_AUTHOR_EMAIL="nitfol@frobozz.com" \ + git commit -a -m "fourth" ' test_expect_success 'log grep (1)' ' @@@ -372,6 -377,28 +377,28 @@@ test_expect_success 'log --grep --autho test_cmp expect actual ' + test_expect_success 'log with multiple --author uses union' ' + git log --author="Thor" --author="Aster" --format=%s >actual && + { + echo third && echo second && echo initial + } >expect && + test_cmp expect actual + ' + + test_expect_success 'log with --grep and multiple --author uses all-match' ' + git log --author="Thor" --author="Night" --grep=i --format=%s >actual && + { + echo third && echo initial + } >expect && + test_cmp expect actual + ' + + test_expect_success 'log with --grep and multiple --author uses all-match' ' + git log --author="Thor" --author="Night" --grep=q --format=%s >actual && + >expect && + test_cmp expect actual + ' + test_expect_success 'grep with CE_VALID file' ' git update-index --assume-unchanged t/t && rm t/t &&