Merge branch 'jc/grep-header-all-match-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:49:57 +0000 (13:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:49:57 +0000 (13:49 -0700)
* 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

1  2 
t/t7810-grep.sh
diff --combined t/t7810-grep.sh
index 023f225a4b1f22c66fb291a76690564696d56035,dc5c08548bb9e0ad7d42d9a6bc88e0756badf457..50658845ca8769e963cfc13b20efb892f1f63cc0
@@@ -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 &&