summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2011-07-02 01:08:42 +0300
committerKirill A. Shutemov <kirill@shutemov.name>2011-07-05 17:52:39 +0300
commit245adf4f3cc1d47352e626ef53372d07761d84cf (patch)
tree5efc730cc37ada82ad4a1e927bc7f1d3a7877a41 /include/git2/index.h
parent476c42acc554e7b3f79c945c2a461d4e25dde41c (diff)
downloadlibgit2-245adf4f3cc1d47352e626ef53372d07761d84cf.tar.gz
index: introduce git_index_uniq() function
It removes all entries with equal path except last added. On large indexes git_index_append() + git_index_uniq() before writing is *much* faster, than git_index_add(). Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 83a18e16..d34ed0a9 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -173,6 +173,13 @@ GIT_EXTERN(int) git_index_write(git_index *index);
GIT_EXTERN(int) git_index_find(git_index *index, const char *path);
/**
+ * Remove all entries with equal path except last added
+ *
+ * @param index an existing index object
+ */
+GIT_EXTERN(void) git_index_uniq(git_index *index);
+
+/**
* Add or update an index entry from a file in disk
*
* The file `path` must be relative to the repository's