X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft7002-grep.sh;h=18fe6f2d576d35706b1a712292b58155680cc9dc;hb=3aa1f7ca3779f73164b285c070b71abcdd7397c1;hp=c8b4f65f380f3941c75bd6ed52975777d2b28d67;hpb=547905f8cd2a04b3e1117f00025b60f81aa60f47;p=git.git diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index c8b4f65f3..18fe6f2d5 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -22,6 +22,7 @@ test_expect_success setup ' mkdir t && echo test >t/t && git add file x y z t/t && + test_tick && git commit -m initial ' @@ -108,9 +109,59 @@ do ' test_expect_success "grep -c $L (no /dev/null)" ' - ! git grep -c test $H | grep -q /dev/null + ! git grep -c test $H | grep /dev/null ' done +test_expect_success 'log grep setup' ' + echo a >>file && + test_tick && + GIT_AUTHOR_NAME="With * Asterisk" \ + GIT_AUTHOR_EMAIL="xyzzy@frotz.com" \ + git commit -a -m "second" && + + echo a >>file && + test_tick && + git commit -a -m "third" + +' + +test_expect_success 'log grep (1)' ' + git log --author=author --pretty=tformat:%s >actual && + ( echo third ; echo initial ) >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (2)' ' + git log --author=" * " -F --pretty=tformat:%s >actual && + ( echo second ) >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (3)' ' + git log --author="^A U" --pretty=tformat:%s >actual && + ( echo third ; echo initial ) >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (4)' ' + git log --author="frotz\.com>$" --pretty=tformat:%s >actual && + ( echo second ) >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (5)' ' + git log --author=Thor -F --grep=Thu --pretty=tformat:%s >actual && + ( echo third ; echo initial ) >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (6)' ' + git log --author=-0700 --pretty=tformat:%s >actual && + >expect && + test_cmp expect actual + +' + test_done