diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2008-06-27 18:21:55 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-30 22:45:50 -0700 |
commit | 653194758ee338b7c87d011007c532ed5cf68d45 (patch) | |
tree | 4cdb427cd0ac9833f6df95e504375e70f6c9eb7d /commit.c | |
parent | 0989fe9623dc8d98033f6acdcc0c84ec28571b19 (diff) | |
download | git-653194758ee338b7c87d011007c532ed5cf68d45.tar.gz |
Move commit_list_count() to commit.c
This function is useful outside builtin-merge-recursive, for example in
builtin-merge.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -325,6 +325,14 @@ struct commit_list *commit_list_insert(struct commit *item, struct commit_list * return new_list; } +unsigned commit_list_count(const struct commit_list *l) +{ + unsigned c = 0; + for (; l; l = l->next ) + c++; + return c; +} + void free_commit_list(struct commit_list *list) { while (list) { |