]> git.ipfire.org Git - thirdparty/git.git/blobdiff - send-pack.c
Clear fd after closing to avoid double-close error
[thirdparty/git.git] / send-pack.c
index 7d172ef37f7b185f9586ce9015a08481d0bd259c..edbfd076a9ebb6883753d77f66580db97851f9c0 100644 (file)
@@ -300,8 +300,12 @@ int send_pack(struct send_pack_args *args,
                                shutdown(fd[0], SHUT_WR);
                        if (use_sideband)
                                finish_async(&demux);
+                       fd[1] = -1;
                        return -1;
                }
+               if (!args->stateless_rpc)
+                       /* Closed by pack_objects() via start_command() */
+                       fd[1] = -1;
        }
        if (args->stateless_rpc && cmds_sent)
                packet_flush(out);