mirror of
https://github.com/git/git.git
synced 2024-11-25 02:44:48 +08:00
Add testcase for amending and fixing author in git commit.
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>
This commit is contained in:
parent
193f7e98da
commit
d63c2fd192
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user