builtin-reflog.c: guard config parser from value=NULL
gc.reflogexpire and gc.reflogexpireunreachable configuration expect a string value suitable for calling approxidate() with. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
995c45279e
commit
4f342b96d1
@ -307,13 +307,19 @@ static int collect_reflog(const char *ref, const unsigned char *sha1, int unused
|
|||||||
|
|
||||||
static int reflog_expire_config(const char *var, const char *value)
|
static int reflog_expire_config(const char *var, const char *value)
|
||||||
{
|
{
|
||||||
if (!strcmp(var, "gc.reflogexpire"))
|
if (!strcmp(var, "gc.reflogexpire")) {
|
||||||
|
if (!value)
|
||||||
|
config_error_nonbool(var);
|
||||||
default_reflog_expire = approxidate(value);
|
default_reflog_expire = approxidate(value);
|
||||||
else if (!strcmp(var, "gc.reflogexpireunreachable"))
|
return 0;
|
||||||
|
}
|
||||||
|
if (!strcmp(var, "gc.reflogexpireunreachable")) {
|
||||||
|
if (!value)
|
||||||
|
config_error_nonbool(var);
|
||||||
default_reflog_expire_unreachable = approxidate(value);
|
default_reflog_expire_unreachable = approxidate(value);
|
||||||
else
|
return 0;
|
||||||
return git_default_config(var, value);
|
}
|
||||||
return 0;
|
return git_default_config(var, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
|
static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
|
||||||
|
Loading…
Reference in New Issue
Block a user