Skip to content

Commit aba56c8

Browse files
mhaggergitster
authored andcommitted
expire_reflog(): add a "flags" argument
We want to separate the options relevant to the expiry machinery from the options affecting the expiration policy. So add a "flags" argument to expire_reflog() to hold the former. The argument doesn't yet do anything. Signed-off-by: Michael Haggerty <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c48a163 commit aba56c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

builtin/reflog.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static void reflog_expiry_cleanup(struct expire_reflog_cb *cb)
414414
}
415415

416416
static int expire_reflog(const char *refname, const unsigned char *sha1,
417-
struct cmd_reflog_expire_cb *cmd)
417+
unsigned int flags, struct cmd_reflog_expire_cb *cmd)
418418
{
419419
static struct lock_file reflog_lock;
420420
struct expire_reflog_cb cb;
@@ -642,6 +642,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
642642
unsigned long now = time(NULL);
643643
int i, status, do_all;
644644
int explicit_expiry = 0;
645+
unsigned int flags = 0;
645646

646647
default_reflog_expire_unreachable = now - 30 * 24 * 3600;
647648
default_reflog_expire = now - 90 * 24 * 3600;
@@ -711,7 +712,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
711712
for (i = 0; i < collected.nr; i++) {
712713
struct collected_reflog *e = collected.e[i];
713714
set_reflog_expiry_param(&cb, explicit_expiry, e->reflog);
714-
status |= expire_reflog(e->reflog, e->sha1, &cb);
715+
status |= expire_reflog(e->reflog, e->sha1, flags, &cb);
715716
free(e);
716717
}
717718
free(collected.e);
@@ -725,7 +726,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
725726
continue;
726727
}
727728
set_reflog_expiry_param(&cb, explicit_expiry, ref);
728-
status |= expire_reflog(ref, sha1, &cb);
729+
status |= expire_reflog(ref, sha1, flags, &cb);
729730
}
730731
return status;
731732
}
@@ -744,6 +745,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
744745
{
745746
struct cmd_reflog_expire_cb cb;
746747
int i, status = 0;
748+
unsigned int flags = 0;
747749

748750
memset(&cb, 0, sizeof(cb));
749751

@@ -796,7 +798,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
796798
cb.expire_total = 0;
797799
}
798800

799-
status |= expire_reflog(ref, sha1, &cb);
801+
status |= expire_reflog(ref, sha1, flags, &cb);
800802
free(ref);
801803
}
802804
return status;

0 commit comments

Comments
 (0)