summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0989fe9)
raw | patch | inline | side by side (parent: 0989fe9)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Fri, 27 Jun 2008 16:21:55 +0000 (18:21 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Jul 2008 05:45:50 +0000 (22:45 -0700) |
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>
builtin-merge.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge-recursive.c | patch | blob | history | |
commit.c | patch | blob | history | |
commit.h | patch | blob | history |
index 43bf6aa45eeacbb67490c809070f40023ce4e434..3731853f83be37d3790a5db8ef037af0b0a4f7c5 100644 (file)
* - *(int *)commit->object.sha1 set to the virtual id.
*/
-static unsigned commit_list_count(const struct commit_list *l)
-{
- unsigned c = 0;
- for (; l; l = l->next )
- c++;
- return c;
-}
-
static struct commit *make_virtual_commit(struct tree *tree, const char *comment)
{
struct commit *commit = xcalloc(1, sizeof(struct commit));
diff --git a/commit.c b/commit.c
index e2d8624d9c19adde87ae521361f4ccd8260c06a0..bbf9c75416537f4e64416d54b03cd00f9d0a56db 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -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) {
diff --git a/commit.h b/commit.h
index 2d94d4148ed4048469ba79cae4f6ff2a2e3f9bca..7f8c5ee0fc15fd93c83a29d350d12fdb956657b9 100644 (file)
--- a/commit.h
+++ b/commit.h
int parse_commit(struct commit *item);
struct commit_list * commit_list_insert(struct commit *item, struct commit_list **list_p);
+unsigned commit_list_count(const struct commit_list *l);
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list);
void free_commit_list(struct commit_list *list);