MCPcopy Index your code
hub / github.com/git/git / get_protocol_version_config

Function get_protocol_version_config

protocol.c:21–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21enum protocol_version get_protocol_version_config(void)
22{
23 const char *value;
24 const char *git_test_k = "GIT_TEST_PROTOCOL_VERSION";
25 const char *git_test_v;
26
27 if (!repo_config_get_string_tmp(the_repository, "protocol.version", &value)) {
28 enum protocol_version version = parse_protocol_version(value);
29
30 if (version == protocol_unknown_version)
31 die("unknown value for config 'protocol.version': %s",
32 value);
33
34 return version;
35 }
36
37 git_test_v = getenv(git_test_k);
38 if (git_test_v && *git_test_v) {
39 enum protocol_version env = parse_protocol_version(git_test_v);
40
41 if (env == protocol_unknown_version)
42 die("unknown value for %s: %s", git_test_k, git_test_v);
43 return env;
44 }
45
46 return protocol_v2;
47}
48
49enum protocol_version determine_protocol_version_server(void)
50{

Callers 3

git_connectFunction · 0.85
discover_refsFunction · 0.85
process_connect_serviceFunction · 0.85

Calls 3

parse_protocol_versionFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected