summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-03-15 17:31:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-15 19:01:09 (GMT)
commit49e85e95006e6a8e544372e529834319fcb0987c (patch)
treec0be305b159706468e5b500c67d6c1f4108348cf /remote-curl.c
parentf08a5d42ea0567af12e703948b6859e30129ec1c (diff)
downloadgit-49e85e95006e6a8e544372e529834319fcb0987c.zip
git-49e85e95006e6a8e544372e529834319fcb0987c.tar.gz
git-49e85e95006e6a8e544372e529834319fcb0987c.tar.bz2
remote-curl: store the protocol version the server responded with
Store the protocol version the server responded with when performing discovery. This will be used in a future patch to either change the 'Git-Protocol' header sent in subsequent requests or to determine if a client needs to fallback to using a different protocol version. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 4086aa7..c540358 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -171,6 +171,7 @@ struct discovery {
size_t len;
struct ref *refs;
struct oid_array shallow;
+ enum protocol_version version;
unsigned proto_git : 1;
};
static struct discovery *last_discovery;
@@ -184,7 +185,8 @@ static struct ref *parse_git_refs(struct discovery *heads, int for_push)
PACKET_READ_CHOMP_NEWLINE |
PACKET_READ_GENTLE_ON_EOF);
- switch (discover_version(&reader)) {
+ heads->version = discover_version(&reader);
+ switch (heads->version) {
case protocol_v2:
die("support for protocol v2 not implemented yet");
break;