From: David Bryson Date: Tue, 30 Sep 2008 19:53:55 GMT Subject: [PATCH] Use "git_config_string" to simplify "builtin-gc.c" code where "prune_expire" is set Message-ID: <20080930195355.GA14499@eratosthenes.cryptobackpack.org> In-Reply-To: <20080930190549.GA9869@eratosthenes.cryptobackpack.org> Signed-off-by: David Bryson --- builtin-gc.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/builtin-gc.c b/builtin-gc.c index fac200e..6260652 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -57,15 +57,12 @@ static int gc_config(const char *var, const char *value, void *cb) return 0; } if (!strcmp(var, "gc.pruneexpire")) { - if (!value) - return config_error_nonbool(var); - if (strcmp(value, "now")) { + if (value && strcmp(value, "now")) { unsigned long now = approxidate("now"); if (approxidate(value) >= now) return error("Invalid %s: '%s'", var, value); } - prune_expire = xstrdup(value); - return 0; + return git_config_string(&prune_expire, var, value); } return git_default_config(var, value, cb); } -- 1.6.0.2