diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-02-04 13:07:02 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-04 13:07:02 -0800 |
commit | a4f004bffcea5b2cd8671738305962afe7b1d08f (patch) | |
tree | 2116e03bd949b3bb4c6e50f5088b1192706e19eb /t | |
parent | b63bc0bc3152ca42ba1c9fa9bed73da061beeca2 (diff) | |
parent | a79ec62d064e32b5c3979a16d215fdb70fe965c0 (diff) | |
download | git-a4f004bffcea5b2cd8671738305962afe7b1d08f.tar.gz git-a4f004bffcea5b2cd8671738305962afe7b1d08f.tar.xz |
Merge branch 'ns/am-slacker'
* ns/am-slacker:
git-am: Add --ignore-date option
am: Add --committer-date-is-author-date option
Conflicts:
git-am.sh
Diffstat (limited to 't')
-rwxr-xr-x | t/t4150-am.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 796f79526..5e65afa0c 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -257,4 +257,37 @@ test_expect_success 'am works from file (absolute path given) in subdirectory' ' test -z "$(git diff second)" ' +test_expect_success 'am --committer-date-is-author-date' ' + git checkout first && + test_tick && + git am --committer-date-is-author-date patch1 && + git cat-file commit HEAD | sed -e "/^$/q" >head1 && + at=$(sed -ne "/^author /s/.*> //p" head1) && + ct=$(sed -ne "/^committer /s/.*> //p" head1) && + test "$at" = "$ct" +' + +test_expect_success 'am without --committer-date-is-author-date' ' + git checkout first && + test_tick && + git am patch1 && + git cat-file commit HEAD | sed -e "/^$/q" >head1 && + at=$(sed -ne "/^author /s/.*> //p" head1) && + ct=$(sed -ne "/^committer /s/.*> //p" head1) && + test "$at" != "$ct" +' + +# This checks for +0000 because TZ is set to UTC and that should +# show up when the current time is used. The date in message is set +# by test_tick that uses -0700 timezone; if this feature does not +# work, we will see that instead of +0000. +test_expect_success 'am --ignore-date' ' + git checkout first && + test_tick && + git am --ignore-date patch1 && + git cat-file commit HEAD | sed -e "/^$/q" >head1 && + at=$(sed -ne "/^author /s/.*> //p" head1) && + echo "$at" | grep "+0000" +' + test_done |