apply: do not read from the filesystem under --index
[gitweb.git] / send-pack.c
index b228d65613c511ffa59eb3ab254ee2e2b6f26c9b..fab62e3da05913b5a4f76db7ed1c17e5831384d2 100644 (file)
@@ -302,8 +302,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);