summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-04-11 03:43:30 -0700
committerVicent Martí <tanoku@gmail.com>2012-04-11 03:43:30 -0700
commit0a20eee9536e8db0ab8d91f426f971f7151aaefa (patch)
tree7b57890c272e66c0f47ed64753eb5cec31f2bffa /src/fileops.h
parentb78fb64d2f5c1b9e2e834e05e042271147c8d188 (diff)
parent4615f0f71ba849adef08f7a677842af3e0ee3d53 (diff)
downloadlibgit2-0a20eee9536e8db0ab8d91f426f971f7151aaefa.tar.gz
Merge pull request #619 from nulltoken/topic/branches
Basic branch management API
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/fileops.h b/src/fileops.h
index 865b3c9b0..9cc2d1699 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -58,10 +58,25 @@ extern int git_futils_mkdir_r(const char *path, const char *base, const mode_t m
*/
extern int git_futils_mkpath2file(const char *path, const mode_t mode);
+typedef enum {
+ GIT_DIRREMOVAL_EMPTY_HIERARCHY = 0,
+ GIT_DIRREMOVAL_FILES_AND_DIRS = 1,
+ GIT_DIRREMOVAL_ONLY_EMPTY_DIRS = 2,
+} git_directory_removal_type;
+
/**
* Remove path and any files and directories beneath it.
+ *
+ * @param path Path to to top level directory to process.
+ *
+ * @param removal_type GIT_DIRREMOVAL_EMPTY_HIERARCHY to remove a hierarchy
+ * of empty directories (will fail if any file is found), GIT_DIRREMOVAL_FILES_AND_DIRS
+ * to remove a hierarchy of files and folders, GIT_DIRREMOVAL_ONLY_EMPTY_DIRS to only remove
+ * empty directories (no failure on file encounter).
+ *
+ * @return 0 on success; -1 on error.
*/
-extern int git_futils_rmdir_r(const char *path, int force);
+extern int git_futils_rmdir_r(const char *path, enum git_directory_removal_type removal_type);
/**
* Create and open a temporary file with a `_git2_` suffix.