diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-03-12 16:04:46 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-03-14 23:52:32 +0200 |
| commit | 005718280712634486a097427212e652b0e29f36 (patch) | |
| tree | 00aba58f1f723bee77a251382cc3e407e2840fa5 /include/git2/refs.h | |
| parent | 58d06cf120eb9bb9247bb807bb105981bb3482a8 (diff) | |
| download | libgit2-005718280712634486a097427212e652b0e29f36.tar.gz | |
Add new method `git_reference_listall`
Lists all the references in a repository. Listing may be filtered by
reference type.
This should applease Lord Clem.
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 1702d7ee1..4ffc5ce5b 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -218,6 +218,29 @@ GIT_EXTERN(int) git_reference_delete(git_reference *ref); */ GIT_EXTERN(int) git_reference_packall(git_repository *repo); +/** + * Fill a list with all the references that can be found + * in a repository. + * + * 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 string array will be filled with the names of all + * references; these values are owned by the user and + * should be free'd manually when no longer needed, using + * `git_strarray_free`. + * + * @param array Pointer to a git_strarray structure where + * the reference names will be stored + * @param repo Repository where to find the refs + * @param list_flags Filtering flags for the reference + * listing. + * @return 0 on success; error code otherwise + */ +GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, unsigned int list_flags); + /** @} */ GIT_END_DECL #endif |
