diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-12-11 11:14:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-11 11:14:13 -0800 |
commit | 0af22d6fffe5169f641fb9815468ae97e47cd73f (patch) | |
tree | e61f2ffb0f66e0d8c5892c0795b6f8a521e4f2c9 /builtin/show-branch.c | |
parent | Merge branch 'as/subtree-with-spaces' into maint (diff) | |
parent | use pop_commit() for consuming the first entry of a struct commit_list (diff) | |
download | tgif-0af22d6fffe5169f641fb9815468ae97e47cd73f.tar.xz |
Merge branch 'rs/pop-commit' into maint
Code simplification.
* rs/pop-commit:
use pop_commit() for consuming the first entry of a struct commit_list
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r-- | builtin/show-branch.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c index 408ce70307..ff6fa9efb5 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -53,17 +53,6 @@ static struct commit *interesting(struct commit_list *list) return NULL; } -static struct commit *pop_one_commit(struct commit_list **list_p) -{ - struct commit *commit; - struct commit_list *list; - list = *list_p; - commit = list->item; - *list_p = list->next; - free(list); - return commit; -} - struct commit_name { const char *head_name; /* which head's ancestor? */ int generation; /* how many parents away from head_name */ @@ -213,7 +202,7 @@ static void join_revs(struct commit_list **list_p, while (*list_p) { struct commit_list *parents; int still_interesting = !!interesting(*list_p); - struct commit *commit = pop_one_commit(list_p); + struct commit *commit = pop_commit(list_p); int flags = commit->object.flags & all_mask; if (!still_interesting && extra <= 0) @@ -504,7 +493,7 @@ static int show_merge_base(struct commit_list *seen, int num_rev) int exit_status = 1; while (seen) { - struct commit *commit = pop_one_commit(&seen); + struct commit *commit = pop_commit(&seen); int flags = commit->object.flags & all_mask; if (!(flags & UNINTERESTING) && ((flags & all_revs) == all_revs)) { @@ -927,7 +916,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) all_revs = all_mask & ~((1u << REV_SHIFT) - 1); while (seen) { - struct commit *commit = pop_one_commit(&seen); + struct commit *commit = pop_commit(&seen); int this_flag = commit->object.flags; int is_merge_point = ((this_flag & all_revs) == all_revs); |