enum expire_reflog_flags {
EXPIRE_REFLOGS_DRY_RUN = 1 << 0,
- EXPIRE_REFLOGS_UPDATE_REF = 1 << 1
+ EXPIRE_REFLOGS_UPDATE_REF = 1 << 1,
+ EXPIRE_REFLOGS_VERBOSE = 1 << 2
};
struct cmd_reflog_expire_cb {
struct rev_info revs;
int stalefix;
int rewrite;
- int verbose;
unsigned long expire_total;
unsigned long expire_unreachable;
int recno;
message, policy_cb)) {
if (!policy_cb->newlog)
printf("would prune %s", message);
- else if (policy_cb->cmd->verbose)
+ else if (cb->flags & EXPIRE_REFLOGS_VERBOSE)
printf("prune %s", message);
} else {
if (policy_cb->newlog) {
message);
hashcpy(policy_cb->last_kept_sha1, nsha1);
}
- if (policy_cb->cmd->verbose)
+ if (cb->flags & EXPIRE_REFLOGS_VERBOSE)
printf("keep %s", message);
}
return 0;
else if (!strcmp(arg, "--all"))
do_all = 1;
else if (!strcmp(arg, "--verbose"))
- cb.verbose = 1;
+ flags |= EXPIRE_REFLOGS_VERBOSE;
else if (!strcmp(arg, "--")) {
i++;
break;
*/
if (cb.stalefix) {
init_revisions(&cb.revs, prefix);
- if (cb.verbose)
+ if (flags & EXPIRE_REFLOGS_VERBOSE)
printf("Marking reachable objects...");
mark_reachable_objects(&cb.revs, 0, 0, NULL);
- if (cb.verbose)
+ if (flags & EXPIRE_REFLOGS_VERBOSE)
putchar('\n');
}
else if (!strcmp(arg, "--updateref"))
flags |= EXPIRE_REFLOGS_UPDATE_REF;
else if (!strcmp(arg, "--verbose"))
- cb.verbose = 1;
+ flags |= EXPIRE_REFLOGS_VERBOSE;
else if (!strcmp(arg, "--")) {
i++;
break;