summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorSanti Béjar <sbejar@gmail.com>2008-05-04 18:04:51 +0200
committerJunio C Hamano <gitster@pobox.com>2008-05-06 16:50:17 -0700
commitbb1ae3f6fff19b0a1ab1bb6a815d26d39b9f15e6 (patch)
treed11c7e3846690f745e8c6998d56464f21a23e3c9 /t/t7502-commit.sh
parente83dbe802f24e017f2e3889272a70793c064d984 (diff)
downloadgit-bb1ae3f6fff19b0a1ab1bb6a815d26d39b9f15e6.tar.gz
commit: Show committer if automatic
To warn the user in case he/she might be using an unintended committer identity. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 0b1db406a7..018060c60f 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -166,6 +166,21 @@ test_expect_success 'author different from committer' '
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