Merge branch 'jc/perl-git-comment-typofix' into next
[gitweb.git] / builtin / upload-archive.c
index 2caedf184959e2120d8e30a02f885925ceb412b4..84532ae9a93e7fb526a6fd28901875b3a10f3ffa 100644 (file)
@@ -22,7 +22,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
        struct argv_array sent_argv = ARGV_ARRAY_INIT;
        const char *arg_cmd = "argument ";
 
-       if (argc != 2)
+       if (argc != 2 || !strcmp(argv[1], "-h"))
                usage(upload_archive_usage);
 
        if (!enter_repo(argv[1], 0))
@@ -43,7 +43,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
        }
 
        /* parse all options sent by the client */
-       return write_archive(sent_argv.argc, sent_argv.argv, prefix, 0, NULL, 1);
+       return write_archive(sent_argv.argc, sent_argv.argv, prefix, NULL, 1);
 }
 
 __attribute__((format (printf, 1, 2)))
@@ -76,6 +76,9 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
 {
        struct child_process writer = { argv };
 
+       if (argc == 2 && !strcmp(argv[1], "-h"))
+               usage(upload_archive_usage);
+
        /*
         * Set up sideband subprocess.
         *
@@ -88,11 +91,11 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
        writer.git_cmd = 1;
        if (start_command(&writer)) {
                int err = errno;
-               packet_write(1, "NACK unable to spawn subprocess\n");
+               packet_write_fmt(1, "NACK unable to spawn subprocess\n");
                die("upload-archive: %s", strerror(err));
        }
 
-       packet_write(1, "ACK\n");
+       packet_write_fmt(1, "ACK\n");
        packet_flush(1);
 
        while (1) {