threads / discuss / 11160

git-clean and empty pathspec

Subject: git-clean and empty pathspec

## tl;dr

2 messages between Dec 6, 2007 and Dec 7, 2007.

replies: 1people: 2as markdown or json

Shawn Bohrer· Dec 7, 2007, 06:14 UTC · re: Nguyen Thai Ngoc Duy · lore

Re: git-clean and empty pathspec

On Fri, Dec 07, 2007 at 01:21:10AM +0700, Nguyen Thai Ngoc Duy wrote:
> "git clean -n" would not remove directories while "git clean -n -- ''"
> (two single quotes) would. Is there anything wrong with it?

It appears that match_pathspec views this as a recursive match to everything, so git clean thinks that you provided the pathspec for all files and directories and thus will remove them.

Without the '' there is no provided pathspec so git clean will not remove the directories without -d.

Note this is different behavior from the old git-clean.sh.

← back to recent threads