change `git_config()` return value to void
[gitweb.git] / commit.c
index 90a6d2974f321cf045fa801cb3409b8dffeeaddb..dce3d69dfdf5843b6dbae78a5c85a4060ca7604b 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -970,12 +970,7 @@ struct commit_list *get_merge_bases_many(struct commit *one,
        }
 
        /* There are more than one */
-       cnt = 0;
-       list = result;
-       while (list) {
-               list = list->next;
-               cnt++;
-       }
+       cnt = commit_list_count(result);
        rslt = xcalloc(cnt, sizeof(*rslt));
        for (list = result, i = 0; list; list = list->next)
                rslt[i++] = list->item;