Skip to content

Commit 55dfc8d

Browse files
mhaggergitster
authored andcommitted
expire_reflog(): it's not an each_ref_fn anymore
Prior to v1.5.4~14, expire_reflog() had to be an each_ref_fn because it was passed to for_each_reflog(). Since then, there has been no reason for it to implement the each_ref_fn interface. So... * Remove the "unused" parameter (which took the place of "flags", but was really unused). * Declare the last parameter to be (struct cmd_reflog_expire_cb *) rather than (void *). Helped-by: Jonathan Nieder <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c6207a commit 55dfc8d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/reflog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ static int push_tip_to_list(const char *refname, const unsigned char *sha1, int
349349
return 0;
350350
}
351351

352-
static int expire_reflog(const char *ref, const unsigned char *sha1, int unused, void *cb_data)
352+
static int expire_reflog(const char *ref, const unsigned char *sha1,
353+
struct cmd_reflog_expire_cb *cmd)
353354
{
354-
struct cmd_reflog_expire_cb *cmd = cb_data;
355355
struct expire_reflog_cb cb;
356356
struct ref_lock *lock;
357357
char *log_file, *newlog_path = NULL;
@@ -663,7 +663,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
663663
for (i = 0; i < collected.nr; i++) {
664664
struct collected_reflog *e = collected.e[i];
665665
set_reflog_expiry_param(&cb, explicit_expiry, e->reflog);
666-
status |= expire_reflog(e->reflog, e->sha1, 0, &cb);
666+
status |= expire_reflog(e->reflog, e->sha1, &cb);
667667
free(e);
668668
}
669669
free(collected.e);
@@ -677,7 +677,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
677677
continue;
678678
}
679679
set_reflog_expiry_param(&cb, explicit_expiry, ref);
680-
status |= expire_reflog(ref, sha1, 0, &cb);
680+
status |= expire_reflog(ref, sha1, &cb);
681681
}
682682
return status;
683683
}
@@ -748,7 +748,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
748748
cb.expire_total = 0;
749749
}
750750

751-
status |= expire_reflog(ref, sha1, 0, &cb);
751+
status |= expire_reflog(ref, sha1, &cb);
752752
free(ref);
753753
}
754754
return status;

0 commit comments

Comments
 (0)