summaryrefslogtreecommitdiff
path: root/builtin/upload-pack.c
diff options
context:
space:
mode:
authorLibravatar Brandon Williams <bmwill@google.com>2018-03-15 10:31:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-15 12:01:08 -0700
commite52449b672210f4b49e116ca34dcd46657287f61 (patch)
treeacf2751917ca8443909296c28edcb42997ba02f2 /builtin/upload-pack.c
parentls-refs: introduce ls-refs server command (diff)
downloadtgif-e52449b672210f4b49e116ca34dcd46657287f61.tar.xz
connect: request remote refs using v2
Teach the client to be able to request a remote's refs using protocol v2. This is done by having a client issue a 'ls-refs' request to a v2 server. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-pack.c')
-rw-r--r--builtin/upload-pack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 8d53e9794b..a757df8da0 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -5,6 +5,7 @@
#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")),
@@ -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:
/*