@@ -168,7 +168,7 @@ static int reflog_expire_config(const char *var, const char *value,
168168 return 0 ;
169169}
170170
171- static void set_reflog_expiry_param (struct cmd_reflog_expire_cb * cb , const char * ref )
171+ static void set_reflog_expiry_param (struct reflog_expire_options * cb , const char * ref )
172172{
173173 struct reflog_expire_cfg * ent ;
174174
@@ -207,31 +207,31 @@ static int expire_unreachable_callback(const struct option *opt,
207207 const char * arg ,
208208 int unset )
209209{
210- struct cmd_reflog_expire_cb * cmd = opt -> value ;
210+ struct reflog_expire_options * opts = opt -> value ;
211211
212212 BUG_ON_OPT_NEG (unset );
213213
214- if (parse_expiry_date (arg , & cmd -> expire_unreachable ))
214+ if (parse_expiry_date (arg , & opts -> expire_unreachable ))
215215 die (_ ("invalid timestamp '%s' given to '--%s'" ),
216216 arg , opt -> long_name );
217217
218- cmd -> explicit_expiry |= EXPIRE_UNREACH ;
218+ opts -> explicit_expiry |= EXPIRE_UNREACH ;
219219 return 0 ;
220220}
221221
222222static int expire_total_callback (const struct option * opt ,
223223 const char * arg ,
224224 int unset )
225225{
226- struct cmd_reflog_expire_cb * cmd = opt -> value ;
226+ struct reflog_expire_options * opts = opt -> value ;
227227
228228 BUG_ON_OPT_NEG (unset );
229229
230- if (parse_expiry_date (arg , & cmd -> expire_total ))
230+ if (parse_expiry_date (arg , & opts -> expire_total ))
231231 die (_ ("invalid timestamp '%s' given to '--%s'" ),
232232 arg , opt -> long_name );
233233
234- cmd -> explicit_expiry |= EXPIRE_TOTAL ;
234+ opts -> explicit_expiry |= EXPIRE_TOTAL ;
235235 return 0 ;
236236}
237237
@@ -276,7 +276,7 @@ static int cmd_reflog_list(int argc, const char **argv, const char *prefix,
276276static int cmd_reflog_expire (int argc , const char * * argv , const char * prefix ,
277277 struct repository * repo UNUSED )
278278{
279- struct cmd_reflog_expire_cb cmd = { 0 };
279+ struct reflog_expire_options opts = { 0 };
280280 timestamp_t now = time (NULL );
281281 int i , status , do_all , single_worktree = 0 ;
282282 unsigned int flags = 0 ;
@@ -292,15 +292,15 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
292292 N_ ("update the reference to the value of the top reflog entry" ),
293293 EXPIRE_REFLOGS_UPDATE_REF ),
294294 OPT_BOOL (0 , "verbose" , & verbose , N_ ("print extra information on screen" )),
295- OPT_CALLBACK_F (0 , "expire" , & cmd , N_ ("timestamp" ),
295+ OPT_CALLBACK_F (0 , "expire" , & opts , N_ ("timestamp" ),
296296 N_ ("prune entries older than the specified time" ),
297297 PARSE_OPT_NONEG ,
298298 expire_total_callback ),
299- OPT_CALLBACK_F (0 , "expire-unreachable" , & cmd , N_ ("timestamp" ),
299+ OPT_CALLBACK_F (0 , "expire-unreachable" , & opts , N_ ("timestamp" ),
300300 N_ ("prune entries older than <time> that are not reachable from the current tip of the branch" ),
301301 PARSE_OPT_NONEG ,
302302 expire_unreachable_callback ),
303- OPT_BOOL (0 , "stale-fix" , & cmd .stalefix ,
303+ OPT_BOOL (0 , "stale-fix" , & opts .stalefix ,
304304 N_ ("prune any reflog entries that point to broken commits" )),
305305 OPT_BOOL (0 , "all" , & do_all , N_ ("process the reflogs of all references" )),
306306 OPT_BOOL (0 , "single-worktree" , & single_worktree ,
@@ -315,9 +315,9 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
315315 save_commit_buffer = 0 ;
316316 do_all = status = 0 ;
317317
318- cmd .explicit_expiry = 0 ;
319- cmd .expire_total = default_reflog_expire ;
320- cmd .expire_unreachable = default_reflog_expire_unreachable ;
318+ opts .explicit_expiry = 0 ;
319+ opts .expire_total = default_reflog_expire ;
320+ opts .expire_unreachable = default_reflog_expire_unreachable ;
321321
322322 argc = parse_options (argc , argv , prefix , options , reflog_expire_usage , 0 );
323323
@@ -329,7 +329,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
329329 * even in older repository. We cannot trust what's reachable
330330 * from reflog if the repository was pruned with older git.
331331 */
332- if (cmd .stalefix ) {
332+ if (opts .stalefix ) {
333333 struct rev_info revs ;
334334
335335 repo_init_revisions (the_repository , & revs , prefix );
@@ -363,11 +363,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
363363
364364 for_each_string_list_item (item , & collected .reflogs ) {
365365 struct expire_reflog_policy_cb cb = {
366- .cmd = cmd ,
366+ .opts = opts ,
367367 .dry_run = !!(flags & EXPIRE_REFLOGS_DRY_RUN ),
368368 };
369369
370- set_reflog_expiry_param (& cb .cmd , item -> string );
370+ set_reflog_expiry_param (& cb .opts , item -> string );
371371 status |= refs_reflog_expire (get_main_ref_store (the_repository ),
372372 item -> string , flags ,
373373 reflog_expiry_prepare ,
@@ -380,13 +380,13 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
380380
381381 for (i = 0 ; i < argc ; i ++ ) {
382382 char * ref ;
383- struct expire_reflog_policy_cb cb = { .cmd = cmd };
383+ struct expire_reflog_policy_cb cb = { .opts = opts };
384384
385385 if (!repo_dwim_log (the_repository , argv [i ], strlen (argv [i ]), NULL , & ref )) {
386386 status |= error (_ ("%s points nowhere!" ), argv [i ]);
387387 continue ;
388388 }
389- set_reflog_expiry_param (& cb .cmd , ref );
389+ set_reflog_expiry_param (& cb .opts , ref );
390390 status |= refs_reflog_expire (get_main_ref_store (the_repository ),
391391 ref , flags ,
392392 reflog_expiry_prepare ,
0 commit comments