Skip to content

Commit

Permalink
Add testcase for amending and fixing author in git commit.
Browse files Browse the repository at this point in the history
We used to clobber author time, but we shouldn't.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kristian Høgsberg authored and Junio C Hamano committed Nov 23, 2007
1 parent 193f7e9 commit d63c2fd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/t7501-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,19 @@ test_expect_success 'multiple -m' '
'

author="The Real Author <someguy@his.email.org>"
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

0 comments on commit d63c2fd

Please sign in to comment.