summaryrefslogtreecommitdiff
path: root/builtin/reflog.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-12-11 11:14:12 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-12-11 11:14:13 -0800
commit0af22d6fffe5169f641fb9815468ae97e47cd73f (patch)
treee61f2ffb0f66e0d8c5892c0795b6f8a521e4f2c9 /builtin/reflog.c
parentMerge branch 'as/subtree-with-spaces' into maint (diff)
parentuse pop_commit() for consuming the first entry of a struct commit_list (diff)
downloadtgif-0af22d6fffe5169f641fb9815468ae97e47cd73f.tar.xz
Merge branch 'rs/pop-commit' into maint
Code simplification. * rs/pop-commit: use pop_commit() for consuming the first entry of a struct commit_list
Diffstat (limited to 'builtin/reflog.c')
-rw-r--r--builtin/reflog.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/builtin/reflog.c b/builtin/reflog.c
index f96ca2a27d..cf1145e635 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -218,7 +218,6 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
*/
static void mark_reachable(struct expire_reflog_policy_cb *cb)
{
- struct commit *commit;
struct commit_list *pending;
unsigned long expire_limit = cb->mark_limit;
struct commit_list *leftover = NULL;
@@ -228,11 +227,8 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb)
pending = cb->mark_list;
while (pending) {
- struct commit_list *entry = pending;
struct commit_list *parent;
- pending = entry->next;
- commit = entry->item;
- free(entry);
+ struct commit *commit = pop_commit(&pending);
if (commit->object.flags & REACHABLE)
continue;
if (parse_commit(commit))