diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-06-30 15:33:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-29 12:22:30 -0700 |
commit | a0f4afbe87ddda7902e36350d163dea146166550 (patch) | |
tree | 9c90142f461b86ef045d672793b95f135be1970f /dir.h | |
parent | 0a53e9ddeaddad63ad106860237bbf53411d11a7 (diff) | |
download | git-a0f4afbe87ddda7902e36350d163dea146166550.tar.gz git-a0f4afbe87ddda7902e36350d163dea146166550.tar.xz |
clean: require double -f options to nuke nested git repository and work tree
When you have an embedded git work tree in your work tree (be it
an orphaned submodule, or an independent checkout of an unrelated
project), "git clean -d -f" blindly descended into it and removed
everything. This is rarely what the user wants.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -88,7 +88,10 @@ static inline int is_dot_or_dotdot(const char *name) extern int is_empty_dir(const char *dir); extern void setup_standard_excludes(struct dir_struct *dir); -extern int remove_dir_recursively(struct strbuf *path, int only_empty); + +#define REMOVE_DIR_EMPTY_ONLY 01 +#define REMOVE_DIR_KEEP_NESTED_GIT 02 +extern int remove_dir_recursively(struct strbuf *path, int flag); /* tries to remove the path with empty directories along it, ignores ENOENT */ extern int remove_path(const char *path); |