@@ -168,7 +168,7 @@ static int reflog_expire_config(const char *var, const char *value,
168
168
return 0 ;
169
169
}
170
170
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 )
172
172
{
173
173
struct reflog_expire_cfg * ent ;
174
174
@@ -207,31 +207,31 @@ static int expire_unreachable_callback(const struct option *opt,
207
207
const char * arg ,
208
208
int unset )
209
209
{
210
- struct cmd_reflog_expire_cb * cmd = opt -> value ;
210
+ struct reflog_expire_options * opts = opt -> value ;
211
211
212
212
BUG_ON_OPT_NEG (unset );
213
213
214
- if (parse_expiry_date (arg , & cmd -> expire_unreachable ))
214
+ if (parse_expiry_date (arg , & opts -> expire_unreachable ))
215
215
die (_ ("invalid timestamp '%s' given to '--%s'" ),
216
216
arg , opt -> long_name );
217
217
218
- cmd -> explicit_expiry |= EXPIRE_UNREACH ;
218
+ opts -> explicit_expiry |= EXPIRE_UNREACH ;
219
219
return 0 ;
220
220
}
221
221
222
222
static int expire_total_callback (const struct option * opt ,
223
223
const char * arg ,
224
224
int unset )
225
225
{
226
- struct cmd_reflog_expire_cb * cmd = opt -> value ;
226
+ struct reflog_expire_options * opts = opt -> value ;
227
227
228
228
BUG_ON_OPT_NEG (unset );
229
229
230
- if (parse_expiry_date (arg , & cmd -> expire_total ))
230
+ if (parse_expiry_date (arg , & opts -> expire_total ))
231
231
die (_ ("invalid timestamp '%s' given to '--%s'" ),
232
232
arg , opt -> long_name );
233
233
234
- cmd -> explicit_expiry |= EXPIRE_TOTAL ;
234
+ opts -> explicit_expiry |= EXPIRE_TOTAL ;
235
235
return 0 ;
236
236
}
237
237
@@ -276,7 +276,7 @@ static int cmd_reflog_list(int argc, const char **argv, const char *prefix,
276
276
static int cmd_reflog_expire (int argc , const char * * argv , const char * prefix ,
277
277
struct repository * repo UNUSED )
278
278
{
279
- struct cmd_reflog_expire_cb cmd = { 0 };
279
+ struct reflog_expire_options opts = { 0 };
280
280
timestamp_t now = time (NULL );
281
281
int i , status , do_all , single_worktree = 0 ;
282
282
unsigned int flags = 0 ;
@@ -292,15 +292,15 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
292
292
N_ ("update the reference to the value of the top reflog entry" ),
293
293
EXPIRE_REFLOGS_UPDATE_REF ),
294
294
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" ),
296
296
N_ ("prune entries older than the specified time" ),
297
297
PARSE_OPT_NONEG ,
298
298
expire_total_callback ),
299
- OPT_CALLBACK_F (0 , "expire-unreachable" , & cmd , N_ ("timestamp" ),
299
+ OPT_CALLBACK_F (0 , "expire-unreachable" , & opts , N_ ("timestamp" ),
300
300
N_ ("prune entries older than <time> that are not reachable from the current tip of the branch" ),
301
301
PARSE_OPT_NONEG ,
302
302
expire_unreachable_callback ),
303
- OPT_BOOL (0 , "stale-fix" , & cmd .stalefix ,
303
+ OPT_BOOL (0 , "stale-fix" , & opts .stalefix ,
304
304
N_ ("prune any reflog entries that point to broken commits" )),
305
305
OPT_BOOL (0 , "all" , & do_all , N_ ("process the reflogs of all references" )),
306
306
OPT_BOOL (0 , "single-worktree" , & single_worktree ,
@@ -315,9 +315,9 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
315
315
save_commit_buffer = 0 ;
316
316
do_all = status = 0 ;
317
317
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 ;
321
321
322
322
argc = parse_options (argc , argv , prefix , options , reflog_expire_usage , 0 );
323
323
@@ -329,7 +329,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
329
329
* even in older repository. We cannot trust what's reachable
330
330
* from reflog if the repository was pruned with older git.
331
331
*/
332
- if (cmd .stalefix ) {
332
+ if (opts .stalefix ) {
333
333
struct rev_info revs ;
334
334
335
335
repo_init_revisions (the_repository , & revs , prefix );
@@ -363,11 +363,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
363
363
364
364
for_each_string_list_item (item , & collected .reflogs ) {
365
365
struct expire_reflog_policy_cb cb = {
366
- .cmd = cmd ,
366
+ .opts = opts ,
367
367
.dry_run = !!(flags & EXPIRE_REFLOGS_DRY_RUN ),
368
368
};
369
369
370
- set_reflog_expiry_param (& cb .cmd , item -> string );
370
+ set_reflog_expiry_param (& cb .opts , item -> string );
371
371
status |= refs_reflog_expire (get_main_ref_store (the_repository ),
372
372
item -> string , flags ,
373
373
reflog_expiry_prepare ,
@@ -380,13 +380,13 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
380
380
381
381
for (i = 0 ; i < argc ; i ++ ) {
382
382
char * ref ;
383
- struct expire_reflog_policy_cb cb = { .cmd = cmd };
383
+ struct expire_reflog_policy_cb cb = { .opts = opts };
384
384
385
385
if (!repo_dwim_log (the_repository , argv [i ], strlen (argv [i ]), NULL , & ref )) {
386
386
status |= error (_ ("%s points nowhere!" ), argv [i ]);
387
387
continue ;
388
388
}
389
- set_reflog_expiry_param (& cb .cmd , ref );
389
+ set_reflog_expiry_param (& cb .opts , ref );
390
390
status |= refs_reflog_expire (get_main_ref_store (the_repository ),
391
391
ref , flags ,
392
392
reflog_expiry_prepare ,
0 commit comments