From: Junio C Hamano Date: Fri, 24 Mar 2017 19:57:52 +0000 (-0700) Subject: Merge branch 'jk/push-deadlock-regression-fix' into maint X-Git-Tag: v2.12.2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f4d3af185988ad45ebc0a6dead32222cad2c03a6?hp=-c Merge branch 'jk/push-deadlock-regression-fix' into maint "git push" had a handful of codepaths that could lead to a deadlock when unexpected error happened, which has been fixed. * jk/push-deadlock-regression-fix: send-pack: report signal death of pack-objects send-pack: read "unpack" status even on pack-objects failure send-pack: improve unpack-status error messages send-pack: use skip_prefix for parsing unpack status send-pack: extract parsing of "unpack" response receive-pack: fix deadlock when we cannot create tmpdir --- f4d3af185988ad45ebc0a6dead32222cad2c03a6 diff --combined builtin/receive-pack.c index 1dbb8a0692,eb6d25a149..8672825e2e --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@@ -795,8 -795,8 +795,8 @@@ static char *refuse_unconfigured_deny_m "with what you pushed, and will require 'git reset --hard' to match\n" "the work tree to HEAD.\n" "\n" - "You can set 'receive.denyCurrentBranch' configuration variable to\n" - "'ignore' or 'warn' in the remote repository to allow pushing into\n" + "You can set the 'receive.denyCurrentBranch' configuration variable\n" + "to 'ignore' or 'warn' in the remote repository to allow pushing into\n" "its current branch; however, this is not recommended unless you\n" "arranged to update its work tree to match what you pushed in some\n" "other way.\n" @@@ -1664,8 -1664,11 +1664,11 @@@ static const char *unpack(int err_fd, s } tmp_objdir = tmp_objdir_create(); - if (!tmp_objdir) + if (!tmp_objdir) { + if (err_fd > 0) + close(err_fd); return "unable to create temporary object directory"; + } child.env = tmp_objdir_env(tmp_objdir); /* @@@ -1942,7 -1945,8 +1945,7 @@@ int cmd_receive_pack(int argc, const ch run_receive_hook(commands, "post-receive", 1, &push_options); run_update_post_hook(commands); - if (push_options.nr) - string_list_clear(&push_options, 0); + string_list_clear(&push_options, 0); if (auto_gc) { const char *argv_gc_auto[] = { "gc", "--auto", "--quiet", NULL,