Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-11-02 18:33:06 +0300
committerJunio C Hamano <gitster@pobox.com>2007-11-23 04:04:56 +0300
commitd63c2fd192271ea2d85c81edfad90aa42fec26ee (patch)
tree829afba563842d37273152ebba9c9320645ef5f5 /t/t7501-commit.sh
parent193f7e98da72f1012515b0389525cf9a6a269849 (diff)
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>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 9dba104b1f..e601028d02 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -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