remote-curl: store the protocol version the server responded with
[gitweb.git] / remote-curl.c
index 4086aa733b7d7a434af9fb2d9e8969663f0f77f2..c540358438bcc55a1771f1cc6b85e48f2eb5d099 100644 (file)
@@ -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;