X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7810-grep.sh;h=8a7788dc39f236b15e60912c384d835fd1db5a28;hb=70ae2beadd45d1874ffbfba2d5c45ea9fd2af12c;hp=023f225a4b1f22c66fb291a76690564696d56035;hpb=5ce3258122939f93a927c75d308c1c34038f0386;p=git.git diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 023f225a4..8a7788dc3 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -182,6 +182,24 @@ do test_cmp expected actual ' + test_expect_success "grep --max-depth 0 -- . t $L" ' + { + echo ${HC}t/v:1:vvv + echo ${HC}v:1:vvv + } >expected && + git grep --max-depth 0 -n -e vvv $H -- . t >actual && + test_cmp expected actual + ' + + test_expect_success "grep --max-depth 0 -- t . $L" ' + { + echo ${HC}t/v:1:vvv + echo ${HC}v:1:vvv + } >expected && + git grep --max-depth 0 -n -e vvv $H -- t . >actual && + test_cmp expected actual + ' + done cat >expected <>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 +395,28 @@ test_expect_success 'log --grep --author implicitly uses all-match' ' 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 && @@ -452,7 +497,7 @@ test_expect_success 'outside of git repository' ' echo file1:hello && echo sub/file2:world } >non/expect.full && - echo file2:world >non/expect.sub + echo file2:world >non/expect.sub && ( GIT_CEILING_DIRECTORIES="$(pwd)/non/git" && export GIT_CEILING_DIRECTORIES && @@ -478,7 +523,7 @@ test_expect_success 'inside git repository but with --no-index' ' echo sub/file2:world } >is/expect.full && : >is/expect.empty && - echo file2:world >is/expect.sub + echo file2:world >is/expect.sub && ( cd is/git && git init &&