aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-03 18:08:08 -0700
committerJunio C Hamano <gitster@pobox.com>2008-06-03 18:08:08 -0700
commit7845944c64de11d87e3b33ed7fa0a0a4b00fa435 (patch)
tree702463add1dd197529643d753f014a61fc0ec351
parentcat-file --batch: flush stdout also when objects are missing (diff)
downloadgit-7845944c64de11d87e3b33ed7fa0a0a4b00fa435.tar.gz
git-7845944c64de11d87e3b33ed7fa0a0a4b00fa435.zip
t7502: do not globally unset GIT_COMMITTER_* environment variables
One particular test wants to check the behaviour of the command when these variables are not set, but the later tests should have the reliable committer identity for repeatable tests. Move the "unset" of the variables inside a subshell in the test that wants to unset them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7502-commit.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 22a13f7aab..385c8f46e1 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -171,13 +171,16 @@ sed '$d' < expect.tmp > expect
rm -f expect.tmp
echo "# Committer:
#" >> expect
-unset GIT_COMMITTER_EMAIL
-unset GIT_COMMITTER_NAME
test_expect_success 'committer is automatic' '
echo >>negative &&
- git commit -e -m "sample"
+ (
+ unset GIT_COMMITTER_EMAIL
+ unset GIT_COMMITTER_NAME
+ # must fail because there is no change
+ test_must_fail git commit -e -m "sample"
+ ) &&
head -n 8 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual &&
test_cmp expect actual