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>
Kristian Høgsberg committed
Nov 2, 2007 at 11:33 UTC
d63c2fd192271ea2d85c81edfad90aa42fec26ee
1 file changed
+15
t/t7501-commit.sh
+15
@@ -242,4 +242,19 @@ test_expect_success 'multiple -m' '
242
243
'
244
245
+author="The Real Author <someguy@his.email.org>"
246
+test_expect_success 'amend commit to fix author' '
247
+
248
+ oldtick=$GIT_AUTHOR_DATE &&
249
+ test_tick &&
250
+ git reset --hard &&
251
+ git cat-file -p HEAD |
252
+ sed -e "s/author.*/author $author $oldtick/" \
253
+ -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
254
+ expected &&
255
+ git commit --amend --author="$author" &&
256
+ git cat-file -p HEAD > current &&
257
+ diff expected current
258
+
259
+'
260
test_done