Merge branch 'jk/receive-pack-deadlocks-with-early-failure'

When receive-pack detects error in the pack header it received in
order to decide which of unpack-objects or index-pack to run, it
returned without closing the error stream, which led to a hang
sideband thread.

* jk/receive-pack-deadlocks-with-early-failure:
  receive-pack: close sideband fd on early pack errors
This commit is contained in:
Junio C Hamano 2013-04-23 11:16:50 -07:00
commit f87f7424df

View file

@ -826,8 +826,11 @@ static const char *unpack(int err_fd)
: 0);
hdr_err = parse_pack_header(&hdr);
if (hdr_err)
if (hdr_err) {
if (err_fd > 0)
close(err_fd);
return hdr_err;
}
snprintf(hdr_arg, sizeof(hdr_arg),
"--pack_header=%"PRIu32",%"PRIu32,
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));