} unreachable_expire_kind;
struct commit_list *mark_list;
unsigned long mark_limit;
} unreachable_expire_kind;
struct commit_list *mark_list;
unsigned long mark_limit;
struct expire_reflog_policy_cb *cb = cb_data;
struct commit *old, *new;
struct expire_reflog_policy_cb *cb = cb_data;
struct commit *old, *new;
if (cb->unreachable_expire_kind == UE_ALWAYS)
return 1;
if (unreachable(cb, old, osha1) || unreachable(cb, new, nsha1))
return 1;
}
if (cb->unreachable_expire_kind == UE_ALWAYS)
return 1;
if (unreachable(cb, old, osha1) || unreachable(cb, new, nsha1))
return 1;
}
static void reflog_expiry_prepare(const char *refname,
const unsigned char *sha1,
static void reflog_expiry_prepare(const char *refname,
const unsigned char *sha1,
if (cb->unreachable_expire_kind != UE_ALWAYS) {
if (cb->unreachable_expire_kind == UE_HEAD) {
struct commit_list *elem;
if (cb->unreachable_expire_kind != UE_ALWAYS) {
if (cb->unreachable_expire_kind == UE_HEAD) {
struct commit_list *elem;
- cb.expire_total = default_reflog_expire;
- cb.expire_unreachable = default_reflog_expire_unreachable;
+ cb.cmd.expire_total = default_reflog_expire;
+ cb.cmd.expire_unreachable = default_reflog_expire_unreachable;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--dry-run") || !strcmp(arg, "-n"))
flags |= EXPIRE_REFLOGS_DRY_RUN;
else if (starts_with(arg, "--expire=")) {
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--dry-run") || !strcmp(arg, "-n"))
flags |= EXPIRE_REFLOGS_DRY_RUN;
else if (starts_with(arg, "--expire=")) {
die(_("'%s' is not a valid timestamp"), arg);
explicit_expiry |= EXPIRE_TOTAL;
}
else if (starts_with(arg, "--expire-unreachable=")) {
die(_("'%s' is not a valid timestamp"), arg);
explicit_expiry |= EXPIRE_TOTAL;
}
else if (starts_with(arg, "--expire-unreachable=")) {
die(_("'%s' is not a valid timestamp"), arg);
explicit_expiry |= EXPIRE_UNREACH;
}
else if (!strcmp(arg, "--stale-fix"))
die(_("'%s' is not a valid timestamp"), arg);
explicit_expiry |= EXPIRE_UNREACH;
}
else if (!strcmp(arg, "--stale-fix"))
else if (!strcmp(arg, "--rewrite"))
flags |= EXPIRE_REFLOGS_REWRITE;
else if (!strcmp(arg, "--updateref"))
else if (!strcmp(arg, "--rewrite"))
flags |= EXPIRE_REFLOGS_REWRITE;
else if (!strcmp(arg, "--updateref"))
* even in older repository. We cannot trust what's reachable
* from reflog if the repository was pruned with older git.
*/
* even in older repository. We cannot trust what's reachable
* from reflog if the repository was pruned with older git.
*/
- mark_reachable_objects(&cb.revs, 0, 0, NULL);
+ mark_reachable_objects(&cb.cmd.revs, 0, 0, NULL);
for_each_reflog(collect_reflog, &collected);
for (i = 0; i < collected.nr; i++) {
struct collected_reflog *e = collected.e[i];
for_each_reflog(collect_reflog, &collected);
for (i = 0; i < collected.nr; i++) {
struct collected_reflog *e = collected.e[i];
status |= expire_reflog(e->reflog, e->sha1, flags, &cb);
free(e);
}
status |= expire_reflog(e->reflog, e->sha1, flags, &cb);
free(e);
}
status |= expire_reflog(ref, sha1, flags, &cb);
}
return status;
status |= expire_reflog(ref, sha1, flags, &cb);
}
return status;
const char *email, unsigned long timestamp, int tz,
const char *message, void *cb_data)
{
const char *email, unsigned long timestamp, int tz,
const char *message, void *cb_data)
{
- struct cmd_reflog_expire_cb *cb = cb_data;
- if (!cb->expire_total || timestamp < cb->expire_total)
- cb->recno++;
+ struct expire_reflog_policy_cb *cb = cb_data;
+ if (!cb->cmd.expire_total || timestamp < cb->cmd.expire_total)
+ cb->cmd.recno++;
}
status |= expire_reflog(ref, sha1, flags, &cb);
}
status |= expire_reflog(ref, sha1, flags, &cb);