summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-22 17:59:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-22 17:59:37 (GMT)
commit12621cb22224d1c2f507a643a578e386ee891c5c (patch)
treed0ab888b37baa09db9c7ef74840b739ff3cafb09 /pretty.c
parent4328190a81ea5aef679774322c7f9faf06b453af (diff)
parent1cefa143250ad8c60e2a3db6c18278f7bed508f5 (diff)
downloadgit-12621cb22224d1c2f507a643a578e386ee891c5c.zip
git-12621cb22224d1c2f507a643a578e386ee891c5c.tar.gz
git-12621cb22224d1c2f507a643a578e386ee891c5c.tar.bz2
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 'pretty.c')
-rw-r--r--pretty.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/pretty.c b/pretty.c
index eb676d6..3a1da6f 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1554,12 +1554,7 @@ static void pp_header(struct pretty_print_context *pp,
}
if (!parents_shown) {
- struct commit_list *parent;
- int num;
- for (parent = commit->parents, num = 0;
- parent;
- parent = parent->next, num++)
- ;
+ unsigned num = commit_list_count(commit->parents);
/* with enough slop */
strbuf_grow(sb, num * 50 + 20);
add_merge_info(pp, sb, commit);