http: avoid closing index-pack input twice

finish_http_pack_request() passes its staging-file descriptor to index-pack through child_process.in. start_command() takes ownership of a supplied descriptor and closes it, even when starting the child fails. Do not close the descriptor again after run_command() returns. Signed-off-by: Ted Nyman <tnyman@openai.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ted Nyman committed Jul 26, 2026 at 17:28 UTC f0d866a2eafcd012fb8fda8edd6b32da68859d7b
1 file changed +1 -6
http.c
+1 -6
@@ -2704,13 +2704,8 @@ int finish_http_pack_request(struct http_pack_request *preq)
2704 else
2705 ip.no_stdout = 1;
2706
2707 - if (run_command(&ip)) {
2707 + if (run_command(&ip))
2708 ret = -1;
2709 - goto cleanup;
2710 - }
2711 -
2712 -cleanup:
2713 - close(tmpfile_fd);
2709 unlink(preq->tmpfile.buf);
2710 return ret;
2711 }