diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:37 -0700 |
commit | 12621cb22224d1c2f507a643a578e386ee891c5c (patch) | |
tree | d0ab888b37baa09db9c7ef74840b739ff3cafb09 /line-log.c | |
parent | Merge branch 'nd/path-max-must-go' (diff) | |
parent | remote-testsvn: use internal argv_array of struct child_process in cmd_import() (diff) | |
download | tgif-12621cb22224d1c2f507a643a578e386ee891c5c.tar.xz |
Merge branch 'rs/code-cleaning'
* rs/code-cleaning:
remote-testsvn: use internal argv_array of struct child_process in cmd_import()
bundle: use internal argv_array of struct child_process in create_bundle()
fast-import: use hashcmp() for SHA1 hash comparison
transport: simplify fetch_objs_via_rsync() using argv_array
run-command: use internal argv_array of struct child_process in run_hook_ve()
use commit_list_count() to count the members of commit_lists
strbuf: use strbuf_addstr() for adding C strings
Diffstat (limited to 'line-log.c')
-rw-r--r-- | line-log.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/line-log.c b/line-log.c index afcc98db93..1008e72258 100644 --- a/line-log.c +++ b/line-log.c @@ -766,17 +766,6 @@ void line_log_init(struct rev_info *rev, const char *prefix, struct string_list } } -static int count_parents(struct commit *commit) -{ - struct commit_list *parents = commit->parents; - int count = 0; - while (parents) { - count++; - parents = parents->next; - } - return count; -} - static void move_diff_queue(struct diff_queue_struct *dst, struct diff_queue_struct *src) { @@ -1150,7 +1139,7 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm struct commit **parents; struct commit_list *p; int i; - int nparents = count_parents(commit); + int nparents = commit_list_count(commit->parents); diffqueues = xmalloc(nparents * sizeof(*diffqueues)); cand = xmalloc(nparents * sizeof(*cand)); |