summaryrefslogtreecommitdiff
path: root/builtin/reflog.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-30 20:07:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-30 20:07:03 (GMT)
commit0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe (patch)
tree4a25ada2e2aa20ecf3caf6e1af76e2ebf999cb85 /builtin/reflog.c
parent23d58a00e55f0e5803e190ce861c5354cf19484a (diff)
parente510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (diff)
downloadgit-0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe.zip
git-0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe.tar.gz
git-0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe.tar.bz2
Merge branch 'rs/pop-commit'
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 f96ca2a..cf1145e 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))