diff options
| author | Ben Straub <bstraub@github.com> | 2012-07-17 08:08:34 -0700 |
|---|---|---|
| committer | Ben Straub <bstraub@github.com> | 2012-07-17 08:08:34 -0700 |
| commit | bfc65634050dc52e3ed6b4497ebbb511e39d6e1e (patch) | |
| tree | 32b03847b8a152b69bc3b48b6bb32e7b8621f45e /include/git2/branch.h | |
| parent | 1d68fcd04b21a2c5665d0ca6a5543e7166c73457 (diff) | |
| parent | ea5d2ce4cfa6cec89e2d844a70d1eb24bb401c7d (diff) | |
| download | libgit2-bfc65634050dc52e3ed6b4497ebbb511e39d6e1e.tar.gz | |
Merge branch 'development' into clone
Diffstat (limited to 'include/git2/branch.h')
| -rw-r--r-- | include/git2/branch.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index e2432bcfc..8884df15a 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -72,15 +72,7 @@ GIT_EXTERN(int) git_branch_delete( git_branch_t branch_type); /** - * Fill a list with all the branches in the Repository - * - * The string array will be filled with the names of the - * matching branches; these values are owned by the user and - * should be free'd manually when no longer needed, using - * `git_strarray_free`. - * - * @param branch_names Pointer to a git_strarray structure - * where the branch names will be stored. + * Loop over all the branches and issue a callback for each one. * * @param repo Repository where to find the branches. * @@ -88,12 +80,21 @@ GIT_EXTERN(int) git_branch_delete( * 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_list( - git_strarray *branch_names, +GIT_EXTERN(int) git_branch_foreach( git_repository *repo, - unsigned int list_flags); + 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. |
