summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2012-12-11 22:31:21 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2012-12-19 16:57:30 -0600
commit7fcec8342890031a0d22f0d013833badd81091e8 (patch)
tree9b09ab2eb1d111d5662a1f0f0b7fa13df07587d0 /include/git2/repository.h
parent5c3c86b06e84ac70735b2629209de2dcc0e09034 (diff)
downloadlibgit2-7fcec8342890031a0d22f0d013833badd81091e8.tar.gz
fetchhead reading/iterating
Diffstat (limited to 'include/git2/repository.h')
-rw-r--r--include/git2/repository.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 216f59b51..96b47f440 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -490,6 +490,24 @@ GIT_EXTERN(int) git_repository_message(char *out, size_t len, git_repository *re
*/
GIT_EXTERN(int) git_repository_message_remove(git_repository *repo);
+typedef int (*git_repository_fetchhead_foreach_cb)(const char *ref_name,
+ const char *remote_url,
+ const git_oid *oid,
+ unsigned int is_merge,
+ void *payload);
+
+/**
+ * Call callback 'callback' for each entry in the given FETCH_HEAD file.
+ *
+ * @param repo A repository object
+ * @param callback Callback function
+ * @param payload Pointer to callback data (optional)
+ * @return 0 on success, GIT_ENOTFOUND, GIT_EUSER or error
+ */
+GIT_EXTERN(int) git_repository_fetchhead_foreach(git_repository *repo,
+ git_repository_fetchhead_foreach_cb callback,
+ void *payload);
+
/**
* Calculate hash of file using repository filtering rules.
*