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

Function credential_config_callback

credential.c:106–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 const char *url);
105
106static int credential_config_callback(const char *var, const char *value,
107 const struct config_context *ctx UNUSED,
108 void *data)
109{
110 struct credential *c = data;
111 const char *key;
112
113 if (!skip_prefix(var, "credential.", &key))
114 return 0;
115
116 if (!value)
117 return config_error_nonbool(var);
118
119 if (!strcmp(key, "helper")) {
120 if (*value)
121 string_list_append(&c->helpers, value);
122 else
123 string_list_clear(&c->helpers, 0);
124 } else if (!strcmp(key, "username")) {
125 if (!c->username_from_proto) {
126 free(c->username);
127 c->username = xstrdup(value);
128 }
129 }
130 else if (!strcmp(key, "usehttppath"))
131 c->use_http_path = git_config_bool(var, value);
132 else if (!strcmp(key, "sanitizeprompt"))
133 c->sanitize_prompt = git_config_bool(var, value);
134 else if (!strcmp(key, "protectprotocol"))
135 c->protect_protocol = git_config_bool(var, value);
136
137 return 0;
138}
139
140static int proto_is_http(const char *s)
141{

Callers

nothing calls this directly

Calls 5

config_error_nonboolFunction · 0.85
string_list_clearFunction · 0.85
xstrdupFunction · 0.85
git_config_boolFunction · 0.85
string_list_appendFunction · 0.70

Tested by

no test coverage detected