diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-06-21 18:29:38 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-06-21 18:51:27 +0200 |
| commit | a8fd805e2ff73a3825ddfe6f290774ef5a217972 (patch) | |
| tree | 054d10e2bd560544fa102a62594463d5436fbf11 /include/git2/branch.h | |
| parent | 9311423c34bbd369928152c6a2b669204276ddd1 (diff) | |
| download | libgit2-a8fd805e2ff73a3825ddfe6f290774ef5a217972.tar.gz | |
branch: add git_branch_foreach()
Diffstat (limited to 'include/git2/branch.h')
| -rw-r--r-- | include/git2/branch.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index e2432bcfc..f2239a207 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -96,6 +96,31 @@ GIT_EXTERN(int) git_branch_list( unsigned int list_flags); /** + * Loop over all the branches and issue a callback for each one. + * + * @param repo Repository where to find the branches. + * + * @param list_flags Filtering flags for the branch + * listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE + * or a combination of the two. + * + * @param branch_cb Callback to invoke per found branch. + * + * @param payload Extra parameter to callback function. + * + * @return 0 or an error code. + */ +GIT_EXTERN(int) git_branch_foreach( + git_repository *repo, + unsigned int list_flags, + int (*branch_cb)( + const char *branch_name, + git_branch_t branch_type, + void *payload), + void *payload +); + +/** * Move/rename an existing branch reference. * * @param repo Repository where lives the branch. |
