summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-09 10:17:47 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:50 -0800
commit373cf6a932a64d1cbe5f5cd8333546dcc2ca0b92 (patch)
treedb7ea9e143659e4cc6056cfb4467e29adfe81687 /include/git2/refs.h
parent26c1cb91beccb44425864bd233ed0e35f5801868 (diff)
downloadlibgit2-373cf6a932a64d1cbe5f5cd8333546dcc2ca0b92.tar.gz
Update docs for new callback return value behavior
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r--include/git2/refs.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 4041947f6..e2bfa9615 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -310,20 +310,33 @@ typedef int (*git_reference_foreach_name_cb)(const char *name, void *payload);
* Perform a callback on each reference in the repository.
*
* The `callback` function will be called for each reference in the
- * repository, receiving the name of the reference and the `payload` value
+ * repository, receiving the reference object and the `payload` value
* passed to this method. Returning a non-zero value from the callback
* will terminate the iteration.
*
* @param repo Repository where to find the refs
* @param callback Function which will be called for every listed ref
* @param payload Additional data to pass to the callback
- * @return 0 on success, GIT_EUSER on non-zero callback, or error code
+ * @return 0 on success, non-zero callback return value, or error code
*/
GIT_EXTERN(int) git_reference_foreach(
git_repository *repo,
git_reference_foreach_cb callback,
void *payload);
+/**
+ * Perform a callback on the fully-qualified name of each reference.
+ *
+ * The `callback` function will be called for each reference in the
+ * repository, receiving the name of the reference and the `payload` value
+ * passed to this method. Returning a non-zero value from the callback
+ * will terminate the iteration.
+ *
+ * @param repo Repository where to find the refs
+ * @param callback Function which will be called for every listed ref name
+ * @param payload Additional data to pass to the callback
+ * @return 0 on success, non-zero callback return value, or error code
+ */
GIT_EXTERN(int) git_reference_foreach_name(
git_repository *repo,
git_reference_foreach_name_cb callback,