Closed jonsmithers closed 10 years ago
My initial solution was in git-number
(line 144):
if ( $arg =~ m/^[0-9][0-9]*$/ ) {
my @filepaths = split("\n", `git-list $arg`);
@filepaths = map { qq/"$_"/ } @filepaths;
push @args, @filepaths;
$converted=1;
} ...
However, I think the change proposed here (in git-list
) is far more appropriate.
Thanks for making the pull request. I've added your commit to master and also make it handle more characters.
git-list already adds quotations for filenames containing spaces. It should also use quotations for filenames containing parentheses.
Suppose you do
git-number add 3
, where3
corresponds tofile(withParens).txt
. git-number will run:git add file(withParens).txt
Which fails. Parens ought to be escaped or placed inside quotes. This proposed fix changes git-list so that git-number instead runs:git add "file(withParens).txt"