diff options
author | Leo Yang <lyang@topologyinc.com> | 2015-08-17 15:02:02 -0400 |
---|---|---|
committer | Leo Yang <lyang@topologyinc.com> | 2015-09-04 12:24:36 -0400 |
commit | c097f7173daced0f86fd816a72ad5fc0f636484a (patch) | |
tree | 2934468800976cc954f7042f5f7cc89b4ce34921 /include/git2/index.h | |
parent | 1cef6b9f190587a78c65bd3168879be3eb37e0fb (diff) | |
download | libgit2-c097f7173daced0f86fd816a72ad5fc0f636484a.tar.gz |
New API: git_index_find_prefix
Find the first index entry matching a prefix.
Diffstat (limited to 'include/git2/index.h')
-rw-r--r-- | include/git2/index.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index 7caf3ed78..176ba301e 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -643,6 +643,17 @@ GIT_EXTERN(int) git_index_update_all( */ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path); +/** + * Find the first position of any entries matching a prefix. To find the first position + * of a path inside a given folder, suffix the prefix with a '/'. + * + * @param at_pos the address to which the position of the index entry is written (optional) + * @param index an existing index object + * @param prefix the prefix to search for + * @return 0 with valid value in at_pos; an error code otherwise + */ +GIT_EXTERN(int) git_index_find_prefix(size_t *at_pos, git_index *index, const char *prefix); + /**@}*/ /** @name Conflict Index Entry Functions |