diff options
| author | Russell Belfer <rb@github.com> | 2014-03-14 13:53:15 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2014-04-17 14:43:46 -0700 |
| commit | 52bb0476a8ad462c56b1d2c68b6d5f20f947ee50 (patch) | |
| tree | ed4e78ea3062c1b24a78bc82f86685a964fda77e /src/index.h | |
| parent | 8a2834d34173220c56bd1898397c0e6d200f327d (diff) | |
| download | libgit2-52bb0476a8ad462c56b1d2c68b6d5f20f947ee50.tar.gz | |
Clean up index snapshot function naming
Clear up some of the various "find" functions and the snapshot
API naming to be things I like more.
Diffstat (limited to 'src/index.h')
| -rw-r--r-- | src/index.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/index.h b/src/index.h index cb4425885..50a0b4b6c 100644 --- a/src/index.h +++ b/src/index.h @@ -61,11 +61,13 @@ extern int git_index_entry_icmp(const void *a, const void *b); extern int git_index_entry_srch(const void *a, const void *b); extern int git_index_entry_isrch(const void *a, const void *b); -/* Search index for `path`, returning GIT_ENOTFOUND if it does not exist. +/* Search index for `path`, returning GIT_ENOTFOUND if it does not exist + * (but not setting an error message). + * * `at_pos` is set to the position where it is or would be inserted. * Pass `path_len` as strlen of path or 0 to call strlen internally. */ -extern int git_index__find( +extern int git_index__find_pos( size_t *at_pos, git_index *index, const char *path, size_t path_len, int stage); extern void git_index__set_ignore_case(git_index *index, bool ignore_case); @@ -82,13 +84,13 @@ extern int git_index__changed_relative_to(git_index *index, const git_futils_fil /* 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); +extern int git_index_snapshot_new(git_vector *snap, git_index *index); +extern void git_index_snapshot_release(git_vector *snap, 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_srch, +extern int git_index_snapshot_find( + size_t *at_pos, git_vector *snap, git_vector_cmp entry_srch, const char *path, size_t path_len, int stage); + #endif |
