diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-06-24 18:10:30 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-06-25 18:34:37 -0400 |
commit | 8960dc1ec69dd87d33e99e5e26b9982132b05113 (patch) | |
tree | 80fc9229ff7eed6b6354bedc1d241e6a17ada3b5 /src/iterator.h | |
parent | 82b1c93d088319c4e385c11ce738b68103eab96c (diff) | |
download | libgit2-8960dc1ec69dd87d33e99e5e26b9982132b05113.tar.gz |
iterator: provide git_iterator_walk
Provide `git_iterator_walk` to walk each iterator in lockstep,
returning each iterator's idea of the contents of the next path.
Diffstat (limited to 'src/iterator.h')
-rw-r--r-- | src/iterator.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/iterator.h b/src/iterator.h index 57f82416a..893e5db50 100644 --- a/src/iterator.h +++ b/src/iterator.h @@ -294,4 +294,19 @@ extern int git_iterator_advance_over_with_status( */ extern int git_iterator_index(git_index **out, git_iterator *iter); +typedef int (*git_iterator_walk_cb)( + const git_index_entry **entries, + void *data); + +/** + * Walk the given iterators in lock-step. The given callback will be + * called for each unique path, with the index entry in each iterator + * (or NULL if the given iterator does not contain that path). + */ +extern int git_iterator_walk( + git_iterator **iterators, + size_t cnt, + git_iterator_walk_cb cb, + void *data); + #endif |