summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:46 (GMT)
commite1857af92389f47e9365b4f8a718831fa6f96db0 (patch)
tree344e40e32dca647d8bc269b233fb671954f218f0 /t
parent6753d8a85d543253d95184ec2faad6dc197f2486 (diff)
parent14ac2864dcd566a025e449ab9db6b5dc57744a32 (diff)
downloadgit-e1857af92389f47e9365b4f8a718831fa6f96db0.zip
git-e1857af92389f47e9365b4f8a718831fa6f96db0.tar.gz
git-e1857af92389f47e9365b4f8a718831fa6f96db0.tar.bz2
Merge branch 'jk/commit-date-approxidate'
* jk/commit-date-approxidate: commit: accept more date formats for "--date" commit: print "Date" line when the user has set date pretty: make show_ident_date public commit: use split_ident_line to compare author/committer
Diffstat (limited to 't')
-rwxr-xr-xt/t3508-cherry-pick-many-commits.sh6
-rwxr-xr-xt/t7501-commit.sh17
-rwxr-xr-xt/t7502-commit.sh7
3 files changed, 28 insertions, 2 deletions
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 19c99d7..b457333 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -65,12 +65,15 @@ test_expect_success 'output to keep user entertained during multi-pick' '
cat <<-\EOF >expected &&
[master OBJID] second
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:14:13 2005 -0700
1 file changed, 1 insertion(+)
[master OBJID] third
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:15:13 2005 -0700
1 file changed, 1 insertion(+)
[master OBJID] fourth
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:16:13 2005 -0700
1 file changed, 1 insertion(+)
EOF
@@ -98,14 +101,17 @@ test_expect_success 'output during multi-pick indicates merge strategy' '
Trying simple merge.
[master OBJID] second
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:14:13 2005 -0700
1 file changed, 1 insertion(+)
Trying simple merge.
[master OBJID] third
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:15:13 2005 -0700
1 file changed, 1 insertion(+)
Trying simple merge.
[master OBJID] fourth
Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:16:13 2005 -0700
1 file changed, 1 insertion(+)
EOF
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index d58b097..63e0427 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -346,8 +346,21 @@ test_expect_success 'amend commit to fix date' '
'
-test_expect_success 'commit complains about bogus date' '
- test_must_fail git commit --amend --date=10.11.2010
+test_expect_success 'commit mentions forced date in output' '
+ git commit --amend --date=2010-01-02T03:04:05 >output &&
+ grep "Date: *Sat Jan 2 03:04:05 2010" output
+'
+
+test_expect_success 'commit complains about completely bogus dates' '
+ test_must_fail git commit --amend --date=seventeen
+'
+
+test_expect_success 'commit --date allows approxidate' '
+ git commit --amend \
+ --date="midnight the 12th of october, anno domini 1979" &&
+ echo "Fri Oct 12 00:00:00 1979 +0000" >expect &&
+ git log -1 --format=%ad >actual &&
+ test_cmp expect actual
'
test_expect_success 'sign off (1)' '
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 9a3f3a1..6465cd5 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -344,6 +344,13 @@ test_expect_success 'message shows author when it is not equal to committer' '
.git/COMMIT_EDITMSG
'
+test_expect_success 'message shows date when it is explicitly set' '
+ git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" &&
+ test_i18ngrep \
+ "^# Date: *Sat Jan 2 03:04:05 2010 +0000" \
+ .git/COMMIT_EDITMSG
+'
+
test_expect_success AUTOIDENT 'message shows committer when it is automatic' '
echo >>negative &&