summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-05-14 13:45:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-05-14 13:45:20 -0700
commitb66ae7955ca10cf4f59130c9a63b327e4d9df104 (patch)
tree89b6d915cf08c4cccfdb1485c6da3482094f5d4b /t/t7502-commit.sh
parentMerge branch 'bd/tests' (diff)
parentcommit: Show committer if automatic (diff)
downloadtgif-b66ae7955ca10cf4f59130c9a63b327e4d9df104.tar.xz
Merge branch 'sb/committer'
* sb/committer: commit: Show committer if automatic commit: Show author if different from committer Preparation to call determine_author_info from prepare_to_commit
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 284c941247..018060c60f 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -154,6 +154,33 @@ test_expect_success 'cleanup commit messages (strip,-F,-e)' '
'
+echo "#
+# Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
+#" >> expect
+
+test_expect_success 'author different from committer' '
+
+ echo >>negative &&
+ git commit -e -m "sample"
+ head -n 7 .git/COMMIT_EDITMSG >actual &&
+ test_cmp expect actual
+'
+
+sed -i '$d' expect
+echo "# Committer:
+#" >> expect
+unset GIT_COMMITTER_EMAIL
+unset GIT_COMMITTER_NAME
+
+test_expect_success 'committer is automatic' '
+
+ echo >>negative &&
+ git commit -e -m "sample"
+ head -n 8 .git/COMMIT_EDITMSG | \
+ sed "s/^# Committer: .*/# Committer:/" >actual &&
+ test_cmp expect actual
+'
+
pwd=`pwd`
cat >> .git/FAKE_EDITOR << EOF
#! /bin/sh