summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 594ffe8)
raw | patch | inline | side by side (parent: 594ffe8)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 18 Aug 2011 12:29:35 +0000 (19:29 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 18 Aug 2011 18:00:14 +0000 (11:00 -0700) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c | patch | blob | history | |
commit.h | patch | blob | history |
diff --git a/commit.c b/commit.c
index ac337c7d7dc1724fa918f9340816d3102edb10bd..246cd18b0eb6306e8142ae349ddfd753c2c656a1 100644 (file)
--- a/commit.c
+++ b/commit.c
return commit_graft[pos];
}
+int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
+{
+ int i, ret;
+ for (i = ret = 0; i < commit_graft_nr && !ret; i++)
+ ret = fn(commit_graft[i], cb_data);
+ return ret;
+}
+
int write_shallow_commits(struct strbuf *out, int use_pack_protocol)
{
int i, count = 0;
diff --git a/commit.h b/commit.h
index a2d571b97410fa857b4c177325c4556dac50fe3f..9bf3fefea25aa128a8f22dd9586ee0c119cbbac6 100644 (file)
--- a/commit.h
+++ b/commit.h
int nr_parent; /* < 0 if shallow commit */
unsigned char parent[FLEX_ARRAY][20]; /* more */
};
+typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *);
struct commit_graft *read_graft_line(char *buf, int len);
int register_commit_graft(struct commit_graft *, int);
extern int register_shallow(const unsigned char *sha1);
extern int unregister_shallow(const unsigned char *sha1);
extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol);
+extern int for_each_commit_graft(each_commit_graft_fn, void *);
extern int is_repository_shallow(void);
extern struct commit_list *get_shallow_commits(struct object_array *heads,
int depth, int shallow_flag, int not_shallow_flag);