From d63c2fd192271ea2d85c81edfad90aa42fec26ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 2 Nov 2007 11:33:06 -0400 Subject: [PATCH] Add testcase for amending and fixing author in git commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We used to clobber author time, but we shouldn't. Signed-off-by: Kristian Høgsberg Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 9dba104b1..e601028d0 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -242,4 +242,19 @@ test_expect_success 'multiple -m' ' ' +author="The Real Author " +test_expect_success 'amend commit to fix author' ' + + oldtick=$GIT_AUTHOR_DATE && + test_tick && + git reset --hard && + git cat-file -p HEAD | + sed -e "s/author.*/author $author $oldtick/" \ + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && + git commit --amend --author="$author" && + git cat-file -p HEAD > current && + diff expected current + +' test_done -- 2.11.0