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>
This commit is contained in:
René Scharfe
2015-10-24 18:21:31 +02:00
committed by Junio C Hamano
parent 24358560c3
commit e510ab8988
10 changed files with 31 additions and 92 deletions

View File

@ -316,10 +316,8 @@ static int reachable(struct commit *want)
commit_list_insert_by_date(want, &work);
while (work) {
struct commit_list *list = work->next;
struct commit *commit = work->item;
free(work);
work = list;
struct commit_list *list;
struct commit *commit = pop_commit(&work);
if (commit->object.flags & THEY_HAVE) {
want->object.flags |= COMMON_KNOWN;