summaryrefslogtreecommitdiff
path: root/t/t7810-grep.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-09-29 04:41:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-29 18:40:58 (GMT)
commitad4813b3c2513c5dc7e84305ab8a393b32124977 (patch)
tree336f7cc4fdf78e070f8342eeee8a3f11b343012a /t/t7810-grep.sh
parent652398a88e7c3d18b6820a2ae369b05d26dc757f (diff)
downloadgit-ad4813b3c2513c5dc7e84305ab8a393b32124977.zip
git-ad4813b3c2513c5dc7e84305ab8a393b32124977.tar.gz
git-ad4813b3c2513c5dc7e84305ab8a393b32124977.tar.bz2
grep: prepare for new header field filter
grep supports only author and committer headers, which have the same special treatment that later headers may or may not have. Check for field type and only strip_timestamp() when the field is either author or committer. GREP_HEADER_FIELD_MAX is put in the grep_header_field enum to be calculated automatically, correctly, as long as it's at the end of the enum. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 91db352..30eaa9a 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -628,6 +628,18 @@ test_expect_success 'log --all-match --grep --grep --author takes intersection'
test_cmp expect actual
'
+test_expect_success 'log --author does not search in timestamp' '
+ : >expect &&
+ git log --author="$GIT_AUTHOR_DATE" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --committer does not search in timestamp' '
+ : >expect &&
+ git log --committer="$GIT_COMMITTER_DATE" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'grep with CE_VALID file' '
git update-index --assume-unchanged t/t &&
rm t/t &&