git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use "git_config_string" to simplify "builtin-gc.c" code where "prune_expire" is set
@ 2008-09-30 19:05 David Bryson
  2008-09-30 19:37 ` Shawn O. Pearce
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Bryson @ 2008-09-30 19:05 UTC (permalink / raw)
  To: git

Hi all,
This is a quick janitor patch and my first patch sent to the git mailing
list.  Please let me know if I have done any process of the patch
submission wrong, and if I got the Janitorial task done in the proper
fashion.

Signed-off-by: David Bryson <david@statichacks.org>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-30 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-30 19:05 [PATCH] Use "git_config_string" to simplify "builtin-gc.c" code where "prune_expire" is set David Bryson
2008-09-30 19:37 ` Shawn O. Pearce
2008-09-30 19:53 ` David Bryson
2008-09-30 20:04   ` Shawn O. Pearce
2008-09-30 20:28 ` David Bryson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).