Merge branch 'gc/config-context' into next
Reduce reliance on a global state in the config reading API. * gc/config-context: config: pass source to config_parser_event_fn_t config: add kvi.path, use it to evaluate includes config.c: remove config_reader from configsets config: pass kvi to die_bad_number() trace2: plumb config kvi config.c: pass ctx with CLI config config: pass ctx with config files config.c: pass ctx in configsets config: add ctx arg to config_fn_t urlmatch.h: use config_fn_t type config: inline git_color_default_config
This commit is contained in:
@ -110,7 +110,8 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
|
||||
#define EXPIRE_TOTAL 01
|
||||
#define EXPIRE_UNREACH 02
|
||||
|
||||
static int reflog_expire_config(const char *var, const char *value, void *cb)
|
||||
static int reflog_expire_config(const char *var, const char *value,
|
||||
const struct config_context *ctx, void *cb)
|
||||
{
|
||||
const char *pattern, *key;
|
||||
size_t pattern_len;
|
||||
@ -119,7 +120,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
|
||||
struct reflog_expire_cfg *ent;
|
||||
|
||||
if (parse_config_key(var, "gc", &pattern, &pattern_len, &key) < 0)
|
||||
return git_default_config(var, value, cb);
|
||||
return git_default_config(var, value, ctx, cb);
|
||||
|
||||
if (!strcmp(key, "reflogexpire")) {
|
||||
slot = EXPIRE_TOTAL;
|
||||
@ -130,7 +131,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
|
||||
if (git_config_expiry_date(&expire, var, value))
|
||||
return -1;
|
||||
} else
|
||||
return git_default_config(var, value, cb);
|
||||
return git_default_config(var, value, ctx, cb);
|
||||
|
||||
if (!pattern) {
|
||||
switch (slot) {
|
||||
|
Reference in New Issue
Block a user