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:

committed by
Junio C Hamano

parent
24358560c3
commit
e510ab8988
@ -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 = '.';
|
||||
|
Reference in New Issue
Block a user