summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-01-03 15:48:52 -0800
committerRussell Belfer <rb@github.com>2013-01-04 15:47:44 -0800
commit7fc00435829d24021a477c6d6413f3d7b3e37e27 (patch)
treec8d3e6895606afd3be8913c01d03feefcae0fdaf /include/git2/index.h
parent1b88faf7aea53a72a4906f48ec30f16f1c157503 (diff)
downloadlibgit2-7fc00435829d24021a477c6d6413f3d7b3e37e27.tar.gz
Add index API to remove all files in a directory
This adds the git_index_remove_directory API plus tests.
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index fa9a19785..1d21403ad 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -313,6 +313,17 @@ GIT_EXTERN(const git_index_entry *) git_index_get_bypath(
GIT_EXTERN(int) git_index_remove(git_index *index, const char *path, int stage);
/**
+ * Remove all entries from the index under a given directory
+ *
+ * @param index an existing index object
+ * @param dir container directory path
+ * @param stage stage to search
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_index_remove_directory(
+ git_index *index, const char *dir, int stage);
+
+/**
* Add or update an index entry from an in-memory struct
*
* If a previous index entry exists that has the same path and stage