Git.pm: localise $? in command_close_bidi_pipe()
commit108c2aaf7984081daa6aed6d3947c7c0952216c2
authorAbhijit Menon-Sen <ams@toroid.org>
Mon, 4 Aug 2008 11:38:27 +0000 (4 17:08 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Aug 2008 04:51:17 +0000 (4 21:51 -0700)
tree659dc0c3bbab67fac09d5263a93327c4de0f245d
parentc72e0db1ff686e93478ee21a3e80a9ca73143753
Git.pm: localise $? in command_close_bidi_pipe()

Git::DESTROY calls _close_cat_blob and _close_hash_and_insert_object,
which in turn call command_close_bidi_pipe, which calls waitpid, which
alters $?. If this happens during global destruction, it may alter the
program's exit status unexpectedly. Making $? local to the function
solves the problem.

(The problem was discovered due to a failure of test #8 in
t9106-git-svn-commit-diff-clobber.sh.)

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
perl/Git.pm