summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-03-14 18:31:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-14 21:15:07 (GMT)
commit8f6982b4e16c60bba713a3b6592b2ff5c7476974 (patch)
tree2cc541fc7eac51ebf0a8aee415851f56d8eae64e /builtin
parent432e95651031025e421ae2f521f7c0d9f60c527c (diff)
downloadgit-8f6982b4e16c60bba713a3b6592b2ff5c7476974.zip
git-8f6982b4e16c60bba713a3b6592b2ff5c7476974.tar.gz
git-8f6982b4e16c60bba713a3b6592b2ff5c7476974.tar.bz2
protocol: introduce enum protocol_version value protocol_v2
Introduce protocol_v2, a new value for 'enum protocol_version'. Subsequent patches will fill in the implementation of protocol_v2. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch-pack.c2
-rw-r--r--builtin/receive-pack.c6
-rw-r--r--builtin/send-pack.c3
-rw-r--r--builtin/upload-pack.c7
4 files changed, 18 insertions, 0 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 85d4faf..b2374dd 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -201,6 +201,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
PACKET_READ_GENTLE_ON_EOF);
switch (discover_version(&reader)) {
+ case protocol_v2:
+ die("support for protocol v2 not implemented yet");
case protocol_v1:
case protocol_v0:
get_remote_heads(&reader, &ref, 0, NULL, &shallow);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index b7ce7c7..3656e94 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1963,6 +1963,12 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
unpack_limit = receive_unpack_limit;
switch (determine_protocol_version_server()) {
+ case protocol_v2:
+ /*
+ * push support for protocol v2 has not been implemented yet,
+ * so ignore the request to use v2 and fallback to using v0.
+ */
+ break;
case protocol_v1:
/*
* v1 is just the original protocol with a version string,
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 83cb125..b5427f7 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -263,6 +263,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
PACKET_READ_GENTLE_ON_EOF);
switch (discover_version(&reader)) {
+ case protocol_v2:
+ die("support for protocol v2 not implemented yet");
+ break;
case protocol_v1:
case protocol_v0:
get_remote_heads(&reader, &remote_refs, REF_NORMAL,
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 2cb5cb3..8d53e97 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -47,6 +47,13 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
die("'%s' does not appear to be a git repository", dir);
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);
+ break;
case protocol_v1:
/*
* v1 is just the original protocol with a version string,