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 <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Dec 12, 2014 at 09:56 UTC aba56c89b21ebe64f38c521c0962c45eb4d23749
1 file changed +6 -4
builtin/reflog.c
+6 -4
@@ -414,7 +414,7 @@ static void reflog_expiry_cleanup(struct expire_reflog_cb *cb)
414 }
415
416 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)
418 {
419 static struct lock_file reflog_lock;
420 struct expire_reflog_cb cb;
@@ -642,6 +642,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
642 unsigned long now = time(NULL);
643 int i, status, do_all;
644 int explicit_expiry = 0;
645 + unsigned int flags = 0;
646
647 default_reflog_expire_unreachable = now - 30 * 24 * 3600;
648 default_reflog_expire = now - 90 * 24 * 3600;
@@ -711,7 +712,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
712 for (i = 0; i < collected.nr; i++) {
713 struct collected_reflog *e = collected.e[i];
714 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);
716 free(e);
717 }
718 free(collected.e);
@@ -725,7 +726,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
726 continue;
727 }
728 set_reflog_expiry_param(&cb, explicit_expiry, ref);
728 - status |= expire_reflog(ref, sha1, &cb);
729 + status |= expire_reflog(ref, sha1, flags, &cb);
730 }
731 return status;
732 }
@@ -744,6 +745,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
745 {
746 struct cmd_reflog_expire_cb cb;
747 int i, status = 0;
748 + unsigned int flags = 0;
749
750 memset(&cb, 0, sizeof(cb));
751
@@ -796,7 +798,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
798 cb.expire_total = 0;
799 }
800
799 - status |= expire_reflog(ref, sha1, &cb);
801 + status |= expire_reflog(ref, sha1, flags, &cb);
802 free(ref);
803 }
804 return status;