# git-clean and empty pathspec

2 messages from 2007-12-06 to 2007-12-07. Participants: Nguyen Thai Ngoc Duy, Shawn Bohrer.
Thread: https://gitlist.dev/t/11160

## Nguyen Thai Ngoc Duy, 2007-12-06 18:21

Subject: git-clean and empty pathspec
Message-ID: <fcaeb9bf0712061021o5383f538h3a086a913ac1b05d@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0712061021o5383f538h3a086a913ac1b05d%40mail.gmail.com

```
"git clean -n" would not remove directories while "git clean -n -- ''"
(two single quotes) would. Is there anything wrong with it?
-- 
Duy

```

## Shawn Bohrer, 2007-12-07 06:14

Subject: Re: git-clean and empty pathspec
Message-ID: <20071207061402.GB21347@mediacenter.austin.rr.com>
URL: https://gitlist.dev/e/20071207061402.GB21347%40mediacenter.austin.rr.com
In-Reply-To: <fcaeb9bf0712061021o5383f538h3a086a913ac1b05d@mail.gmail.com>

```
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.

```
