@@ -55,6 +55,17 @@ static void remove_pidfile_on_signal(int signo)
55
55
raise (signo );
56
56
}
57
57
58
+ static void git_config_date_string (const char * key , const char * * output )
59
+ {
60
+ if (git_config_get_string_const (key , output ))
61
+ return ;
62
+ if (strcmp (* output , "now" )) {
63
+ unsigned long now = approxidate ("now" );
64
+ if (approxidate (* output ) >= now )
65
+ git_die_config (key , _ ("Invalid %s: '%s'" ), key , * output );
66
+ }
67
+ }
68
+
58
69
static void gc_config (void )
59
70
{
60
71
const char * value ;
@@ -71,16 +82,7 @@ static void gc_config(void)
71
82
git_config_get_int ("gc.auto" , & gc_auto_threshold );
72
83
git_config_get_int ("gc.autopacklimit" , & gc_auto_pack_limit );
73
84
git_config_get_bool ("gc.autodetach" , & detach_auto );
74
-
75
- if (!git_config_get_string_const ("gc.pruneexpire" , & prune_expire )) {
76
- if (strcmp (prune_expire , "now" )) {
77
- unsigned long now = approxidate ("now" );
78
- if (approxidate (prune_expire ) >= now ) {
79
- git_die_config ("gc.pruneexpire" , _ ("Invalid gc.pruneexpire: '%s'" ),
80
- prune_expire );
81
- }
82
- }
83
- }
85
+ git_config_date_string ("gc.pruneexpire" , & prune_expire );
84
86
git_config (git_default_config , NULL );
85
87
}
86
88
0 commit comments