diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-03-25 23:53:38 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-03-25 23:53:38 +0200 |
| commit | 09e8de0f38ed8f28c02e5a3fa987cbb74e98a671 (patch) | |
| tree | cc296d1beb507b92fc305a36ad1da8ec03e1535a /include/git2/refs.h | |
| parent | 051d6915d70e6fec597fe1bfdee2870561f523d1 (diff) | |
| download | libgit2-09e8de0f38ed8f28c02e5a3fa987cbb74e98a671.tar.gz | |
New external API method: `git_reference_listcb`
List all the references in the repository, calling a custom
callback for each one.
The listed references may be filtered by type, or using
a bitwise OR of several types. Use the magic value
`GIT_REF_LISTALL` to obtain all references, including
packed ones.
The `callback` function will be called for each of the references
in the repository, and will receive the name of the reference and
the `payload` value passed to this method.
Diffstat (limited to 'include/git2/refs.h')
| -rw-r--r-- | include/git2/refs.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h index 4ffc5ce5b..da55eaa3b 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -241,6 +241,29 @@ GIT_EXTERN(int) git_reference_packall(git_repository *repo); */ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, unsigned int list_flags); + +/** + * List all the references in the repository, calling a custom + * callback for each one. + * + * The listed references may be filtered by type, or using + * a bitwise OR of several types. Use the magic value + * `GIT_REF_LISTALL` to obtain all references, including + * packed ones. + * + * The `callback` function will be called for each of the references + * in the repository, and will receive the name of the reference and + * the `payload` value passed to this method. + * + * @param repo Repository where to find the refs + * @param list_flags Filtering flags for the reference + * listing. + * @param callback Function which will be called for every listed ref + * @param payload Additional data to pass to the callback + * @return 0 on success; error code otherwise + */ +GIT_EXTERN(int) git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload); + /** @} */ GIT_END_DECL #endif |
