@matheusbsbs / matheus-bagliano / commits / 7845944c64
Fork 0

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>

Junio C Hamano committed Jun 3, 2008 at 18:08 UTC 7845944c64de11d87e3b33ed7fa0a0a4b00fa435
1 file changed +6 -3
t/t7502-commit.sh
+6 -3
@@ -171,13 +171,16 @@ sed '$d' < expect.tmp > expect
171 rm -f expect.tmp
172 echo "# Committer:
173 #" >> expect
174 -unset GIT_COMMITTER_EMAIL
175 -unset GIT_COMMITTER_NAME
174
175 test_expect_success 'committer is automatic' '
176
177 echo >>negative &&
180 - git commit -e -m "sample"
178 + (
179 + unset GIT_COMMITTER_EMAIL
180 + unset GIT_COMMITTER_NAME
181 + # must fail because there is no change
182 + test_must_fail git commit -e -m "sample"
183 + ) &&
184 head -n 8 .git/COMMIT_EDITMSG | \
185 sed "s/^# Committer: .*/# Committer:/" >actual &&
186 test_cmp expect actual