diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-11-07 01:24:45 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-11-07 01:24:45 +0200 |
commit | 3f43678e889a7ee77b1cd2e40727f104ea3d7ac1 (patch) | |
tree | 3040907d3c6db401458989961619ea019f09b5cb /src/git/index.h | |
parent | 88d035bd1502d507554f59d6c699b3759bc2b758 (diff) | |
download | libgit2-3f43678e889a7ee77b1cd2e40727f104ea3d7ac1.tar.gz |
Make the Index API public
Several private methods of the Index API are now public, including the
methods to remove, get and add index entries.
All the methods only take an integer value for the position of the entry
to get/remove. To get or remove entries based on their path names, look
them up first using the git_index_find method.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/index.h')
-rw-r--r-- | src/git/index.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/git/index.h b/src/git/index.h index ee410865d..bdfb7e192 100644 --- a/src/git/index.h +++ b/src/git/index.h @@ -108,14 +108,32 @@ GIT_EXTERN(int) git_index_write(git_index *index); GIT_EXTERN(int) git_index_find(git_index *index, const char *path); /** - * Add a new empty entry to the index. + * Add a new empty entry to the index with a given path. * * @param index an existing index object * @param path filename pointed to by the entry * @param stage stage for the entry * @return 0 on success, otherwise an error code */ -GIT_EXTERN(int) git_index_add(git_index *index, const char *path, int stage); +GIT_EXTERN(int) git_index_add_bypath(git_index *index, const char *path, int stage); + +/** + * Remove an entry from the index + * + * @param index an existing index object + * @param position position of the entry to remove + * @return 0 on success, otherwise an error code + */ +GIT_EXTERN(int) git_index_remove(git_index *index, int position); + +/** + * Add a new entry to the index + * + * @param index an existing index object + * @param source_entry new entry object + * @return 0 on success, otherwise an error code + */ +GIT_EXTERN(int) git_index_add(git_index *index, const git_index_entry *source_entry); /** * Get a pointer to one of the entries in the index |