summaryrefslogtreecommitdiff
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-10-24 16:21:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-26 21:06:46 (GMT)
commite510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (patch)
treee189dbe7cc56b89b1d8c2e1d884db8d1da6e4a8b /builtin/rev-parse.c
parent24358560c3c0ab51c9ef8178d99f46711716f6c0 (diff)
downloadgit-e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b.zip
git-e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b.tar.gz
git-e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b.tar.bz2
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/rev-parse.c')
-rw-r--r--builtin/rev-parse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 02d747d..e92a782 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -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 = '.';