# Bug in git clean

1 messages from 2013-10-11 to 2013-10-11. Participants: jones.noamle@gmail.com.
Thread: https://gitlist.dev/t/35109

## jones.noamle@gmail.com, 2013-10-11 19:05

Subject: Bug in git clean
Message-ID: <CAMUDzVQqUT91OTbC21pke6jzF8kWBZJAvnyvHhrt-O3=y5bJLQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMUDzVQqUT91OTbC21pke6jzF8kWBZJAvnyvHhrt-O3%3Dy5bJLQ%40mail.gmail.com

```
Hi.

Passing to git clean wrong (non-existent) paths together with valid
ones, causes it to delete stuff that it shouldn't.
Am I right?
Script to reproduce:

mkdir test
cd test
git init .
mkdir ba
mkdir ba/ca

# So far so good.
# Should clean directory "ba/ca"
git clean -dn -- ba/ca

# Should clean "ba/ca" and ignore non-existent "j"
# Instead, it wants to delete "ba" totally.
git clean -dn -- ba/ca j

git --version

---------------------------------------------------------------------
Output:

+ mkdir test
+ cd test
+ git init .
Initialized empty Git repository in /home/notroot/test/.git/
+ mkdir ba
+ mkdir ba/ca
+ git clean -dn -- ba/ca
Would remove ba/ca/
+ git clean -dn -- ba/ca j
Would remove ba/
+ git --version
git version 1.7.9.5

---------------------------------------------------------------------

Tested on linux (version 1.7.9.5) and cygwin (1.7.9)

Thanks!
Noam Lewis
Hadas Nahon

```
