aboutsummaryrefslogtreecommitdiff
path: root/builtin/reflog.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-10-24 18:21:31 +0200
committerJunio C Hamano <gitster@pobox.com>2015-10-26 14:06:46 -0700
commite510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (patch)
treee189dbe7cc56b89b1d8c2e1d884db8d1da6e4a8b /builtin/reflog.c
parent24358560c3c0ab51c9ef8178d99f46711716f6c0 (diff)
downloadgit-e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b.tar.gz
git-e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b.tar.xz
use pop_commit() for consuming the first entry of a struct commit_list
Instead of open-coding the function pop_commit() just call it. This makes the intent clearer and reduces code size. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 c2eb8ff84..fa841b500 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -216,7 +216,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;
@@ -226,11 +225,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))