Re: [PATCH 10/23] expire_reflog(): add a "flags" argument
From: Stefan Beller <hidden>
Date: 2016-06-15 23:03:14
On Fri, Dec 05, 2014 at 12:08:22AM +0100, Michael Haggerty wrote:
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 <redacted>
Reviewed-by: <redacted>
quoted hunk ↗ jump to hunk
--- builtin/reflog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)diff --git a/builtin/reflog.c b/builtin/reflog.c index ebfa635..319f0d2 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c@@ -415,7 +415,8 @@ static void reflog_expiry_cleanup(struct expire_reflog_cb *cb) static struct lock_file reflog_lock; -static int expire_reflog(const char *refname, const unsigned char *sha1, void *cb_data) +static int expire_reflog(const char *refname, const unsigned char *sha1, + unsigned int flags, void *cb_data) { struct cmd_reflog_expire_cb *cmd = cb_data; struct expire_reflog_cb cb;@@ -627,6 +628,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix) unsigned long now = time(NULL); int i, status, do_all; int explicit_expiry = 0; + unsigned int flags = 0; default_reflog_expire_unreachable = now - 30 * 24 * 3600; default_reflog_expire = now - 90 * 24 * 3600;@@ -696,7 +698,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix) for (i = 0; i < collected.nr; i++) { struct collected_reflog *e = collected.e[i]; set_reflog_expiry_param(&cb, explicit_expiry, e->reflog); - status |= expire_reflog(e->reflog, e->sha1, &cb); + status |= expire_reflog(e->reflog, e->sha1, flags, &cb); free(e); } free(collected.e);@@ -710,7 +712,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix) continue; } set_reflog_expiry_param(&cb, explicit_expiry, ref); - status |= expire_reflog(ref, sha1, &cb); + status |= expire_reflog(ref, sha1, flags, &cb); } return status; }@@ -729,6 +731,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix) { struct cmd_reflog_expire_cb cb; int i, status = 0; + unsigned int flags = 0; memset(&cb, 0, sizeof(cb));@@ -781,7 +784,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix) cb.expire_total = 0; } - status |= expire_reflog(ref, sha1, &cb); + status |= expire_reflog(ref, sha1, flags, &cb); free(ref); } return status;-- 2.1.3