Re: [BUG] git clean -d is too greedy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was a bit trigger happy posting this, after digging a bit more this is a way more serious than I originally thought.

   1) .gitignore exists in nested repo (either tracked or untracked)
   2) .gitignore is excluded

This can be any file, including those commonly excluded such as *~.

Demonstrating this in a way that looks a lot more likely use case which will potentially wipe out lots of uncommitted work:

# git init -q foo && cd foo
# git init -q bar && cd bar
# touch bar bar~
# git add bar && git commit -qm asd && cd ..
# git clean -e \*~ -dn
Would remove bar/bar

If there were more tracked files in nested repo they'd be removed as well as long as there is at least one excluded file in nested repo.

--
Hermanni



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux