diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-30 23:07:03 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-30 23:07:03 +0300 |
commit | 0692a6c22c37e07ef07a3d2c5d39deaaa3c26ffe (patch) | |
tree | 4a25ada2e2aa20ecf3caf6e1af76e2ebf999cb85 /builtin/fmt-merge-msg.c | |
parent | 23d58a00e55f0e5803e190ce861c5354cf19484a (diff) | |
parent | e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (diff) |
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/fmt-merge-msg.c')
-rw-r--r-- | builtin/fmt-merge-msg.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 4ba7f282a5f..846004b8335 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -537,7 +537,7 @@ static void fmt_merge_msg_sigs(struct strbuf *out) static void find_merge_parents(struct merge_parents *result, struct strbuf *in, unsigned char *head) { - struct commit_list *parents, *next; + struct commit_list *parents; struct commit *head_commit; int pos = 0, i, j; @@ -576,13 +576,10 @@ static void find_merge_parents(struct merge_parents *result, parents = reduce_heads(parents); while (parents) { + struct commit *cmit = pop_commit(&parents); for (i = 0; i < result->nr; i++) - if (!hashcmp(result->item[i].commit, - parents->item->object.sha1)) + if (!hashcmp(result->item[i].commit, cmit->object.sha1)) result->item[i].used = 1; - next = parents->next; - free(parents); - parents = next; } for (i = j = 0; i < result->nr; i++) { |