summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar bert Dvornik <dvornik+git@gmail.com>2010-05-20 20:57:52 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-05-20 16:11:29 -0700
commitfc012c2810c237dd2299a3fc85b18c2beb60b730 (patch)
tree41bc04928e0a2ab24f2c28b8f8c2da153de0820e /t
parentFix "Out of memory? mmap failed" for files larger than 4GB on Windows (diff)
downloadtgif-fc012c2810c237dd2299a3fc85b18c2beb60b730.tar.xz
start_command: close cmd->err descriptor when fork/spawn fails
Fix the problem where the cmd->err passed into start_command wasn't being properly closed when certain types of errors occurr. (Compare the affected code with the clean shutdown code later in the function.) On Windows, this problem would be triggered if mingw_spawnvpe() failed, which would happen if the command to be executed was malformed (e.g. a text file that didn't start with a #! line). If cmd->err was a pipe, the failure to close it could result in a hang while the other side was waiting (forever) for either input or pipe close, e.g. while trying to shove the output into the side band. On msysGit, this problem was causing a hang in t5516-fetch-push. [J6t: With a slight adjustment of the test case, the hang is also observed on Linux.] Signed-off-by: bert Dvornik <dvornik+git@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5516-fetch-push.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 2de98e6561..6a37a4d993 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -528,7 +528,7 @@ test_expect_success 'push does not update local refs on failure' '
mk_test heads/master &&
mk_child child &&
mkdir testrepo/.git/hooks &&
- echo exit 1 >testrepo/.git/hooks/pre-receive &&
+ echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
chmod +x testrepo/.git/hooks/pre-receive &&
(cd child &&
git pull .. master