summaryrefslogtreecommitdiff
path: root/builtin/reflog.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-12-12 08:56:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-12 19:43:49 (GMT)
commitea7b4f6d3368654b1bd751193eaad4eca71991e4 (patch)
treee4c96981ef380939655ec0ec62af161141e57e88 /builtin/reflog.c
parentc4c4fbf86cd6f3d4fee629629d1f7e2e5d81d592 (diff)
downloadgit-ea7b4f6d3368654b1bd751193eaad4eca71991e4.zip
git-ea7b4f6d3368654b1bd751193eaad4eca71991e4.tar.gz
git-ea7b4f6d3368654b1bd751193eaad4eca71991e4.tar.bz2
Rename expire_reflog_cb to expire_reflog_policy_cb
This is the first step towards separating the data needed by the policy code from the data needed by the reflog expiration machinery. (In a moment we will add a *new* "struct expire_reflog_cb" for the use of expire_reflog() itself, then move fields selectively from expire_reflog_policy_cb to expire_reflog_cb.) 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>
Diffstat (limited to 'builtin/reflog.c')
-rw-r--r--builtin/reflog.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/builtin/reflog.c b/builtin/reflog.c
index e238fe0..94c34fc 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -35,7 +35,7 @@ struct cmd_reflog_expire_cb {
int recno;
};
-struct expire_reflog_cb {
+struct expire_reflog_policy_cb {
FILE *newlog;
enum {
UE_NORMAL,
@@ -225,7 +225,7 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
* the expire_limit and queue them back, so that the caller can call
* us again to restart the traversal with longer expire_limit.
*/
-static void mark_reachable(struct expire_reflog_cb *cb)
+static void mark_reachable(struct expire_reflog_policy_cb *cb)
{
struct commit *commit;
struct commit_list *pending;
@@ -264,7 +264,7 @@ static void mark_reachable(struct expire_reflog_cb *cb)
cb->mark_list = leftover;
}
-static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
+static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, unsigned char *sha1)
{
/*
* We may or may not have the commit yet - if not, look it
@@ -300,7 +300,7 @@ static int should_expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
const char *email, unsigned long timestamp, int tz,
const char *message, void *cb_data)
{
- struct expire_reflog_cb *cb = cb_data;
+ struct expire_reflog_policy_cb *cb = cb_data;
struct commit *old, *new;
if (timestamp < cb->cmd->expire_total)
@@ -328,7 +328,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
const char *email, unsigned long timestamp, int tz,
const char *message, void *cb_data)
{
- struct expire_reflog_cb *cb = cb_data;
+ struct expire_reflog_policy_cb *cb = cb_data;
if (cb->cmd->rewrite)
osha1 = cb->last_kept_sha1;
@@ -355,7 +355,8 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
return 0;
}
-static int push_tip_to_list(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
+static int push_tip_to_list(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
struct commit_list **list = cb_data;
struct commit *tip_commit;
@@ -370,7 +371,7 @@ static int push_tip_to_list(const char *refname, const unsigned char *sha1, int
static void reflog_expiry_prepare(const char *refname,
const unsigned char *sha1,
- struct expire_reflog_cb *cb)
+ struct expire_reflog_policy_cb *cb)
{
if (!cb->cmd->expire_unreachable || !strcmp(refname, "HEAD")) {
cb->tip_commit = NULL;
@@ -402,7 +403,7 @@ static void reflog_expiry_prepare(const char *refname,
}
}
-static void reflog_expiry_cleanup(struct expire_reflog_cb *cb)
+static void reflog_expiry_cleanup(struct expire_reflog_policy_cb *cb)
{
if (cb->unreachable_expire_kind != UE_ALWAYS) {
if (cb->unreachable_expire_kind == UE_HEAD) {
@@ -420,7 +421,7 @@ static int expire_reflog(const char *refname, const unsigned char *sha1,
unsigned int flags, struct cmd_reflog_expire_cb *cmd)
{
static struct lock_file reflog_lock;
- struct expire_reflog_cb cb;
+ struct expire_reflog_policy_cb cb;
struct ref_lock *lock;
char *log_file;
int status = 0;