summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-10 01:22:42 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-10 01:22:42 -0800
commit7be2b6e02b4f2a1b4812764f65b12cafb11a934e (patch)
treec94ad7eb3a4d478a1c71eb6ef0aaf1c0f7348660 /t/t7501-commit.sh
parentc07a07c588fea82c2426d795a75324b3035c0a71 (diff)
parent591aa2536fdbc4090ba8d4ca512d4ee7df4bf05d (diff)
downloadgit-7be2b6e02b4f2a1b4812764f65b12cafb11a934e.tar.gz
Merge branch 'master' into cc/help
This is to primarily pull in MANPATH tweak and help.txt formatting fix from the master branch.
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 0316ecf5a1..05aa97d6f3 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -4,7 +4,7 @@
#
# FIXME: Test the various index usages, -i and -o, test reflog,
-# signoff, hooks
+# signoff
test_description='git-commit'
. ./test-lib.sh
@@ -244,8 +244,35 @@ 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_expect_success 'git commit <file> with dirty index' '
+ echo tacocat > elif &&
+ echo tehlulz > chz &&
+ git add chz &&
+ git commit elif -m "tacocat is a palindrome" &&
+ git show --stat | grep elif &&
+ git diff --cached | grep chz
+'
+
test_expect_success 'same tree (single parent)' '
+ git reset --hard
+
if git commit -m empty
then
echo oops -- should have complained