From a0f4afbe87ddda7902e36350d163dea146166550 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 30 Jun 2009 15:33:45 -0700 Subject: 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 --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index e49eaa308..dd9c9ba3f 100644 --- a/refs.c +++ b/refs.c @@ -821,7 +821,7 @@ static int remove_empty_directories(const char *file) strbuf_init(&path, 20); strbuf_addstr(&path, file); - result = remove_dir_recursively(&path, 1); + result = remove_dir_recursively(&path, REMOVE_DIR_EMPTY_ONLY); strbuf_release(&path); -- cgit v1.2.1