ls-remote: the --exit-code option reports "no matching refs"
[gitweb.git] / builtin / send-pack.c
index 8aa303158b2461c9272c8ca5b094149a54cc35d2..4ac2ca984ff36588c68274f10f131ef88023d622 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "builtin.h"
 #include "commit.h"
 #include "refs.h"
 #include "pkt-line.h"
@@ -48,6 +48,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
                NULL,
                NULL,
                NULL,
+               NULL,
        };
        struct child_process po;
        int i;
@@ -59,6 +60,8 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
                argv[i++] = "--delta-base-offset";
        if (args->quiet)
                argv[i++] = "-q";
+       if (args->progress)
+               argv[i++] = "--progress";
        memset(&po, 0, sizeof(po));
        po.argv = argv;
        po.in = -1;
@@ -226,6 +229,9 @@ static void print_helper_status(struct ref *ref)
 static int sideband_demux(int in, int out, void *data)
 {
        int *fd = data;
+#ifdef NO_PTHREADS
+       close(fd[1]);
+#endif
        int ret = recv_sideband("send-pack", fd[0], out);
        close(out);
        return ret;
@@ -336,6 +342,8 @@ int send_pack(struct send_pack_args *args,
                if (pack_objects(out, remote_refs, extra_have, args) < 0) {
                        for (ref = remote_refs; ref; ref = ref->next)
                                ref->status = REF_STATUS_NONE;
+                       if (args->stateless_rpc)
+                               close(out);
                        if (use_sideband)
                                finish_async(&demux);
                        return -1;