summaryrefslogtreecommitdiff
path: root/src/index.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-07 16:48:27 -0800
committerRussell Belfer <rb@github.com>2014-04-17 14:43:45 -0700
commit54edbb9871ad543baefc62310512719fc70539be (patch)
treea1d7e07f2a968d5bdd0fe07623adb1fadea49c73 /src/index.h
parent27e54bcf82fe27bdfadbaa9c5383ee8a948ea33c (diff)
downloadlibgit2-54edbb9871ad543baefc62310512719fc70539be.tar.gz
Add index snapshot and use it for iterator
Diffstat (limited to 'src/index.h')
-rw-r--r--src/index.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/index.h b/src/index.h
index cabdbca30..2b6f5c98b 100644
--- a/src/index.h
+++ b/src/index.h
@@ -71,4 +71,16 @@ GIT_INLINE(const git_futils_filestamp *) git_index__filestamp(git_index *index)
extern int git_index__changed_relative_to(git_index *index, const git_futils_filestamp *fs);
+/* Copy the current entries vector *and* increment the index refcount.
+ * Call `git_index__release_snapshot` when done.
+ */
+extern int git_index__snapshot(git_vector *entries, git_index *index);
+extern void git_index__release_snapshot(git_index *index);
+
+/* Allow searching in a snapshot; entries must already be sorted! */
+extern int git_index__find_in_entries(
+ size_t *at_pos,
+ git_vector *entries, git_vector_cmp entry_cmp,
+ const char *path, size_t path_len, int stage);
+
#endif