diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-08-18 19:29:35 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-18 11:00:14 -0700 |
commit | 09d46644b780ede1a6b757db3e1a1ae9c1128a13 (patch) | |
tree | c45305c4c84b9b5e6789421c338bf3fa760274bd /commit.c | |
parent | 594ffe80e7827b20335c5c6dde2cf57c9919db68 (diff) | |
download | git-09d46644b780ede1a6b757db3e1a1ae9c1128a13.tar.gz |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |