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

Function credential_apply_config

credential.c:172–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172static void credential_apply_config(struct repository *r, struct credential *c)
173{
174 char *normalized_url;
175 struct urlmatch_config config = URLMATCH_CONFIG_INIT;
176 struct strbuf url = STRBUF_INIT;
177
178 if (!c->host)
179 die(_("refusing to work with credential missing host field"));
180 if (!c->protocol)
181 die(_("refusing to work with credential missing protocol field"));
182
183 if (c->configured)
184 return;
185
186 config.section = "credential";
187 config.key = NULL;
188 config.collect_fn = credential_config_callback;
189 config.cascade_fn = NULL;
190 config.select_fn = select_all;
191 config.fallback_match_fn = match_partial_url;
192 config.cb = c;
193
194 credential_format(c, &url);
195 normalized_url = url_normalize(url.buf, &config.url);
196
197 repo_config(r, urlmatch_config_entry, &config);
198 string_list_clear(&config.vars, 1);
199 free(normalized_url);
200 urlmatch_config_release(&config);
201 strbuf_release(&url);
202
203 c->configured = 1;
204
205 if (!c->use_http_path && proto_is_http(c->protocol)) {
206 FREE_AND_NULL(c->path);
207 }
208}
209
210static void credential_describe(struct credential *c, struct strbuf *out)
211{

Callers 3

credential_fillFunction · 0.85
credential_approveFunction · 0.85
credential_rejectFunction · 0.85

Calls 8

credential_formatFunction · 0.85
url_normalizeFunction · 0.85
string_list_clearFunction · 0.85
urlmatch_config_releaseFunction · 0.85
strbuf_releaseFunction · 0.85
proto_is_httpFunction · 0.85
dieFunction · 0.70
repo_configFunction · 0.70

Tested by

no test coverage detected