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

@ -281,11 +281,8 @@ static int try_difference(const char *arg)
b = lookup_commit_reference(end);
exclude = get_merge_bases(a, b);
while (exclude) {
struct commit_list *n = exclude->next;
show_rev(REVERSED,
exclude->item->object.sha1,NULL);
free(exclude);
exclude = n;
struct commit *commit = pop_commit(&exclude);
show_rev(REVERSED, commit->object.sha1, NULL);
}
}
*dotdot = '.';