git-clean fails to remove a file whose name contains \\, ", or \n, TAB, etc.
- From
Jim Meyering <jim@meyering.net>
- Date
- May 8, 2007, 20:32 UTC
- Message-ID
- <87ps5bhx8t.fsf@rho.meyering.net>
Not that it matters (or maybe this is a feature :-), because people who create such files in their working directory deserve what they get, Eh? :-)
But if leaving it, then perhaps git-clean should at least warn that it's not doing its job (i.e. remove the uses of rm's "-f").
To reproduce, run these commands:
nl=' ' git-init > /dev/null && touch "x\\n\"$nl" && git-clean && ls -b
Here's the output I get:
Removing "x\\n\"\n"
.git/ x\\n"\ngit-clean.sh needs to strip off leading and trailing double quotes (easy) as well as convert escapees back to originals (not easy as you might think, in sh) before running rm. Good excuse to rewrite it in perl.