Skip to content

Commit

Permalink
t7502: do not globally unset GIT_COMMITTER_* environment variables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jun 4, 2008
1 parent 422b206 commit 7845944
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions t/t7502-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7845944

Please sign in to comment.