From 7fc00435829d24021a477c6d6413f3d7b3e37e27 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 3 Jan 2013 15:48:52 -0800 Subject: Add index API to remove all files in a directory This adds the git_index_remove_directory API plus tests. --- include/git2/index.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/git2/index.h') 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 @@ -312,6 +312,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 * -- cgit v1.2.1