X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7501-commit.sh;h=7940901d47fd457cda77ee333aa40145433be4d4;hb=c444c16589f95ac22d8e3ffe603cd7f0613512ce;hp=a603f6d21a61df197256ea91bfb38c1f4e45c5e8;hpb=6304c4068e034c5bb780b755cf518010027a1734;p=git.git diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index a603f6d21..7940901d4 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -117,7 +117,11 @@ test_expect_success \ test_expect_success \ "overriding author from command line" \ "echo 'gak' >file && \ - git commit -m 'author' --author 'Rubber Duck ' -a" + git commit -m 'author' --author 'Rubber Duck ' -a >output 2>&1" + +test_expect_success \ + "commit --author output mentions author" \ + "grep Rubber.Duck output" test_expect_success PERL \ "interactive add" \ @@ -211,6 +215,21 @@ test_expect_success 'amend commit to fix author' ' ' +test_expect_success 'amend commit to fix date' ' + + test_tick && + newtick=$GIT_AUTHOR_DATE && + git reset --hard && + git cat-file -p HEAD | + sed -e "s/author.*/author $author $newtick/" \ + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && + git commit --amend --date="$newtick" && + git cat-file -p HEAD > current && + test_cmp expected current + +' + test_expect_success 'sign off (1)' ' echo 1 >positive &&