summaryrefslogtreecommitdiff
path: root/shallow.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 /shallow.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 'shallow.c')
-rw-r--r--shallow.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/shallow.c b/shallow.c
index d49a3d6e9f..4dcb454d18 100644
--- a/shallow.c
+++ b/shallow.c
@@ -401,13 +401,9 @@ static void paint_down(struct paint_info *info, const unsigned char *sha1,
commit_list_insert(c, &head);
while (head) {
struct commit_list *p;
- struct commit *c = head->item;
+ struct commit *c = pop_commit(&head);
uint32_t **refs = ref_bitmap_at(&info->ref_bitmap, c);
- p = head;
- head = head->next;
- free(p);
-
/* XXX check "UNINTERESTING" from pack bitmaps if available */
if (c->object.flags & (SEEN | UNINTERESTING))
continue;