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

Function do_config_from

config.c:1355–1376  ·  view source on GitHub ↗

* All source specific fields in the union, die_on_error, name and the callbacks * fgetc, ungetc, ftell of top need to be initialized before calling * this function. */

Source from the content-addressed store, hash-verified

1353 * this function.
1354 */
1355static int do_config_from(struct config_source *top, config_fn_t fn,
1356 void *data, enum config_scope scope,
1357 const struct config_options *opts)
1358{
1359 struct key_value_info kvi = KVI_INIT;
1360 int ret;
1361
1362 /* push config-file parsing state stack */
1363 top->linenr = 1;
1364 top->eof = 0;
1365 top->total_len = 0;
1366 strbuf_init(&top->value, 1024);
1367 strbuf_init(&top->var, 1024);
1368 kvi_from_source(top, scope, &kvi);
1369
1370 ret = git_parse_source(top, fn, &kvi, data, opts);
1371
1372 strbuf_release(&top->value);
1373 strbuf_release(&top->var);
1374
1375 return ret;
1376}
1377
1378static int do_config_from_file(config_fn_t fn,
1379 const enum config_origin_type origin_type,

Callers 2

do_config_from_fileFunction · 0.85
git_config_from_memFunction · 0.85

Calls 4

strbuf_initFunction · 0.85
kvi_from_sourceFunction · 0.85
git_parse_sourceFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected