Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-08-18 16:29:35 +0400
committerJunio C Hamano <gitster@pobox.com>2011-08-18 22:00:14 +0400
commit09d46644b780ede1a6b757db3e1a1ae9c1128a13 (patch)
treec45305c4c84b9b5e6789421c338bf3fa760274bd /commit.c
parent594ffe80e7827b20335c5c6dde2cf57c9919db68 (diff)
Add for_each_commit_graft() to iterate all grafts
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index ac337c7d7d..246cd18b0e 100644
--- a/commit.c
+++ b/commit.c
@@ -214,6 +214,14 @@ struct commit_graft *lookup_commit_graft(const unsigned char *sha1)
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;