@@ -22,14 +22,14 @@ static unsigned long default_reflog_expire_unreachable;
22
22
23
23
enum expire_reflog_flags {
24
24
EXPIRE_REFLOGS_DRY_RUN = 1 << 0 ,
25
- EXPIRE_REFLOGS_UPDATE_REF = 1 << 1
25
+ EXPIRE_REFLOGS_UPDATE_REF = 1 << 1 ,
26
+ EXPIRE_REFLOGS_VERBOSE = 1 << 2
26
27
};
27
28
28
29
struct cmd_reflog_expire_cb {
29
30
struct rev_info revs ;
30
31
int stalefix ;
31
32
int rewrite ;
32
- int verbose ;
33
33
unsigned long expire_total ;
34
34
unsigned long expire_unreachable ;
35
35
int recno ;
@@ -344,7 +344,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
344
344
message , policy_cb )) {
345
345
if (!policy_cb -> newlog )
346
346
printf ("would prune %s" , message );
347
- else if (policy_cb -> cmd -> verbose )
347
+ else if (cb -> flags & EXPIRE_REFLOGS_VERBOSE )
348
348
printf ("prune %s" , message );
349
349
} else {
350
350
if (policy_cb -> newlog ) {
@@ -356,7 +356,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
356
356
message );
357
357
hashcpy (policy_cb -> last_kept_sha1 , nsha1 );
358
358
}
359
- if (policy_cb -> cmd -> verbose )
359
+ if (cb -> flags & EXPIRE_REFLOGS_VERBOSE )
360
360
printf ("keep %s" , message );
361
361
}
362
362
return 0 ;
@@ -693,7 +693,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
693
693
else if (!strcmp (arg , "--all" ))
694
694
do_all = 1 ;
695
695
else if (!strcmp (arg , "--verbose" ))
696
- cb . verbose = 1 ;
696
+ flags |= EXPIRE_REFLOGS_VERBOSE ;
697
697
else if (!strcmp (arg , "--" )) {
698
698
i ++ ;
699
699
break ;
@@ -711,10 +711,10 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
711
711
*/
712
712
if (cb .stalefix ) {
713
713
init_revisions (& cb .revs , prefix );
714
- if (cb . verbose )
714
+ if (flags & EXPIRE_REFLOGS_VERBOSE )
715
715
printf ("Marking reachable objects..." );
716
716
mark_reachable_objects (& cb .revs , 0 , 0 , NULL );
717
- if (cb . verbose )
717
+ if (flags & EXPIRE_REFLOGS_VERBOSE )
718
718
putchar ('\n' );
719
719
}
720
720
@@ -773,7 +773,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
773
773
else if (!strcmp (arg , "--updateref" ))
774
774
flags |= EXPIRE_REFLOGS_UPDATE_REF ;
775
775
else if (!strcmp (arg , "--verbose" ))
776
- cb . verbose = 1 ;
776
+ flags |= EXPIRE_REFLOGS_VERBOSE ;
777
777
else if (!strcmp (arg , "--" )) {
778
778
i ++ ;
779
779
break ;
0 commit comments