diff options
author | Vicent Martà <tanoku@gmail.com> | 2011-04-23 14:08:17 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2011-04-23 14:08:17 -0700 |
commit | f16c0a9db783548d7b28cad726c5af8923a3ac32 (patch) | |
tree | 52f28484c17a781152da61becef2db6a652430b1 /include/git2/index.h | |
parent | 5ba7c4cbae5b3af908df1e9e78eb703810d7f43d (diff) | |
parent | 729b6f490068642f35ca933ef44830fda11b6aef (diff) | |
download | libgit2-f16c0a9db783548d7b28cad726c5af8923a3ac32.tar.gz |
Merged pull request #140 from jpfender/insert-replace.
index: Allow user to toggle whether to replace an index entry
Diffstat (limited to 'include/git2/index.h')
-rw-r--r-- | include/git2/index.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index 8a84f507b..adc4cb435 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -203,15 +203,16 @@ GIT_EXTERN(int) git_index_remove(git_index *index, int position); /** * Insert an entry into the index. * A full copy (including the 'path' string) of the given - * 'source_entry' will be inserted on the index; if the index - * already contains an entry for the same path, the entry - * will be updated. + * 'source_entry' will be inserted on the index; if the + * replace flag is not set and the index already contains + * an entry for the same path, the entry will be updated. * * @param index an existing index object * @param source_entry new entry object + * @param replace if set, existing entries will be replaced * @return 0 on success, otherwise an error code */ -GIT_EXTERN(int) git_index_insert(git_index *index, const git_index_entry *source_entry); +GIT_EXTERN(int) git_index_insert(git_index *index, const git_index_entry *source_entry, int replace); /** * Get a pointer to one of the entries in the index |