@@ -180,7 +180,32 @@ static void gc_config(void)
180180 git_config (git_default_config , NULL );
181181}
182182
183- struct maintenance_run_opts ;
183+ enum schedule_priority {
184+ SCHEDULE_NONE = 0 ,
185+ SCHEDULE_WEEKLY = 1 ,
186+ SCHEDULE_DAILY = 2 ,
187+ SCHEDULE_HOURLY = 3 ,
188+ };
189+
190+ static enum schedule_priority parse_schedule (const char * value )
191+ {
192+ if (!value )
193+ return SCHEDULE_NONE ;
194+ if (!strcasecmp (value , "hourly" ))
195+ return SCHEDULE_HOURLY ;
196+ if (!strcasecmp (value , "daily" ))
197+ return SCHEDULE_DAILY ;
198+ if (!strcasecmp (value , "weekly" ))
199+ return SCHEDULE_WEEKLY ;
200+ return SCHEDULE_NONE ;
201+ }
202+
203+ struct maintenance_run_opts {
204+ int auto_flag ;
205+ int quiet ;
206+ enum schedule_priority schedule ;
207+ };
208+
184209static int maintenance_task_pack_refs (MAYBE_UNUSED struct maintenance_run_opts * opts )
185210{
186211 struct child_process cmd = CHILD_PROCESS_INIT ;
@@ -773,26 +798,6 @@ static const char *const builtin_maintenance_run_usage[] = {
773798 NULL
774799};
775800
776- enum schedule_priority {
777- SCHEDULE_NONE = 0 ,
778- SCHEDULE_WEEKLY = 1 ,
779- SCHEDULE_DAILY = 2 ,
780- SCHEDULE_HOURLY = 3 ,
781- };
782-
783- static enum schedule_priority parse_schedule (const char * value )
784- {
785- if (!value )
786- return SCHEDULE_NONE ;
787- if (!strcasecmp (value , "hourly" ))
788- return SCHEDULE_HOURLY ;
789- if (!strcasecmp (value , "daily" ))
790- return SCHEDULE_DAILY ;
791- if (!strcasecmp (value , "weekly" ))
792- return SCHEDULE_WEEKLY ;
793- return SCHEDULE_NONE ;
794- }
795-
796801static int maintenance_opt_schedule (const struct option * opt , const char * arg ,
797802 int unset )
798803{
@@ -809,12 +814,6 @@ static int maintenance_opt_schedule(const struct option *opt, const char *arg,
809814 return 0 ;
810815}
811816
812- struct maintenance_run_opts {
813- int auto_flag ;
814- int quiet ;
815- enum schedule_priority schedule ;
816- };
817-
818817/* Remember to update object flag allocation in object.h */
819818#define SEEN (1u<<0)
820819
0 commit comments