status: do not report errors in sequencer/todo
[gitweb.git] / builtin / upload-pack.c
index 8d53e9794b17451f9dd0ad13eab6b294736cde69..42dc4da5a1fc047baa9f71288670c3b981cb3b7e 100644 (file)
@@ -1,10 +1,11 @@
 #include "cache.h"
 #include "builtin.h"
-#include "exec_cmd.h"
+#include "exec-cmd.h"
 #include "pkt-line.h"
 #include "parse-options.h"
 #include "protocol.h"
 #include "upload-pack.h"
+#include "serve.h"
 
 static const char * const upload_pack_usage[] = {
        N_("git upload-pack [<options>] <dir>"),
@@ -16,6 +17,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
        const char *dir;
        int strict = 0;
        struct upload_pack_options opts = { 0 };
+       struct serve_options serve_opts = SERVE_OPTIONS_INIT;
        struct option options[] = {
                OPT_BOOL(0, "stateless-rpc", &opts.stateless_rpc,
                         N_("quit after a single request/response exchange")),
@@ -29,7 +31,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
        };
 
        packet_trace_identity("upload-pack");
-       check_replace_refs = 0;
+       read_replace_refs = 0;
 
        argc = parse_options(argc, argv, NULL, options, upload_pack_usage, 0);
 
@@ -48,11 +50,9 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
 
        switch (determine_protocol_version_server()) {
        case protocol_v2:
-               /*
-                * fetch support for protocol v2 has not been implemented yet,
-                * so ignore the request to use v2 and fallback to using v0.
-                */
-               upload_pack(&opts);
+               serve_opts.advertise_capabilities = opts.advertise_refs;
+               serve_opts.stateless_rpc = opts.stateless_rpc;
+               serve(&serve_opts);
                break;
        case protocol_v1:
                /*