diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2012-12-11 22:31:21 -0600 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2012-12-19 16:57:30 -0600 |
commit | 7fcec8342890031a0d22f0d013833badd81091e8 (patch) | |
tree | 9b09ab2eb1d111d5662a1f0f0b7fa13df07587d0 /include/git2 | |
parent | 5c3c86b06e84ac70735b2629209de2dcc0e09034 (diff) | |
download | libgit2-7fcec8342890031a0d22f0d013833badd81091e8.tar.gz |
fetchhead reading/iterating
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/errors.h | 1 | ||||
-rw-r--r-- | include/git2/repository.h | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index 63b6bc8ee..8ca900969 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -63,6 +63,7 @@ typedef enum { GITERR_THREAD, GITERR_STASH, GITERR_CHECKOUT, + GITERR_FETCHHEAD, } git_error_t; /** 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. * |