aboutsummaryrefslogtreecommitdiff
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-30 13:07:03 -0700
committerJunio C Hamano <gitster@pobox.com>2015-10-30 13:07:03 -0700
commit0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe (patch)
tree4a25ada2e2aa20ecf3caf6e1af76e2ebf999cb85 /builtin/rev-parse.c
parent23d58a00e55f0e5803e190ce861c5354cf19484a (diff)
parente510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (diff)
downloadgit-0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe.tar.gz
git-0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe.tar.xz
Merge branch 'rs/pop-commit'
Code simplification. * rs/pop-commit: use pop_commit() for consuming the first entry of a struct commit_list
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 02d747dcb..e92a782f7 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 = '.';