Skip to content

Commit ea7b4f6

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c4c4fbf commit ea7b4f6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

builtin/reflog.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct cmd_reflog_expire_cb {
3535
int recno;
3636
};
3737

38-
struct expire_reflog_cb {
38+
struct expire_reflog_policy_cb {
3939
FILE *newlog;
4040
enum {
4141
UE_NORMAL,
@@ -225,7 +225,7 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
225225
* the expire_limit and queue them back, so that the caller can call
226226
* us again to restart the traversal with longer expire_limit.
227227
*/
228-
static void mark_reachable(struct expire_reflog_cb *cb)
228+
static void mark_reachable(struct expire_reflog_policy_cb *cb)
229229
{
230230
struct commit *commit;
231231
struct commit_list *pending;
@@ -264,7 +264,7 @@ static void mark_reachable(struct expire_reflog_cb *cb)
264264
cb->mark_list = leftover;
265265
}
266266

267-
static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsigned char *sha1)
267+
static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, unsigned char *sha1)
268268
{
269269
/*
270270
* 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,
300300
const char *email, unsigned long timestamp, int tz,
301301
const char *message, void *cb_data)
302302
{
303-
struct expire_reflog_cb *cb = cb_data;
303+
struct expire_reflog_policy_cb *cb = cb_data;
304304
struct commit *old, *new;
305305

306306
if (timestamp < cb->cmd->expire_total)
@@ -328,7 +328,7 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
328328
const char *email, unsigned long timestamp, int tz,
329329
const char *message, void *cb_data)
330330
{
331-
struct expire_reflog_cb *cb = cb_data;
331+
struct expire_reflog_policy_cb *cb = cb_data;
332332

333333
if (cb->cmd->rewrite)
334334
osha1 = cb->last_kept_sha1;
@@ -355,7 +355,8 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
355355
return 0;
356356
}
357357

358-
static int push_tip_to_list(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
358+
static int push_tip_to_list(const char *refname, const unsigned char *sha1,
359+
int flags, void *cb_data)
359360
{
360361
struct commit_list **list = cb_data;
361362
struct commit *tip_commit;
@@ -370,7 +371,7 @@ static int push_tip_to_list(const char *refname, const unsigned char *sha1, int
370371

371372
static void reflog_expiry_prepare(const char *refname,
372373
const unsigned char *sha1,
373-
struct expire_reflog_cb *cb)
374+
struct expire_reflog_policy_cb *cb)
374375
{
375376
if (!cb->cmd->expire_unreachable || !strcmp(refname, "HEAD")) {
376377
cb->tip_commit = NULL;
@@ -402,7 +403,7 @@ static void reflog_expiry_prepare(const char *refname,
402403
}
403404
}
404405

405-
static void reflog_expiry_cleanup(struct expire_reflog_cb *cb)
406+
static void reflog_expiry_cleanup(struct expire_reflog_policy_cb *cb)
406407
{
407408
if (cb->unreachable_expire_kind != UE_ALWAYS) {
408409
if (cb->unreachable_expire_kind == UE_HEAD) {
@@ -420,7 +421,7 @@ static int expire_reflog(const char *refname, const unsigned char *sha1,
420421
unsigned int flags, struct cmd_reflog_expire_cb *cmd)
421422
{
422423
static struct lock_file reflog_lock;
423-
struct expire_reflog_cb cb;
424+
struct expire_reflog_policy_cb cb;
424425
struct ref_lock *lock;
425426
char *log_file;
426427
int status = 0;

0 commit comments

Comments
 (0)