Skip to content

Commit 49e85e9

Browse files
bmwillgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f08a5d4 commit 49e85e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

remote-curl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ struct discovery {
171171
size_t len;
172172
struct ref *refs;
173173
struct oid_array shallow;
174+
enum protocol_version version;
174175
unsigned proto_git : 1;
175176
};
176177
static struct discovery *last_discovery;
@@ -184,7 +185,8 @@ static struct ref *parse_git_refs(struct discovery *heads, int for_push)
184185
PACKET_READ_CHOMP_NEWLINE |
185186
PACKET_READ_GENTLE_ON_EOF);
186187

187-
switch (discover_version(&reader)) {
188+
heads->version = discover_version(&reader);
189+
switch (heads->version) {
188190
case protocol_v2:
189191
die("support for protocol v2 not implemented yet");
190192
break;

0 commit comments

Comments
 (0)