1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 22:06:20 +02:00

cvsimport: apply shell-quoting regex globally

Commit 5b4efea666 (cvsimport: shell-quote variable used in
backticks, 2017-09-11) tried to shell-quote a variable, but
forgot to use the "/g" modifier to apply the quoting to the
whole variable. This means we'd miss any embedded
single-quotes after the first one.

Reported-by: <littlelailo@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2017-12-08 04:58:19 -05:00 committed by Junio C Hamano
parent 5b4efea666
commit 8c87bdfb21

View File

@ -642,7 +642,7 @@ sub is_sha1 {
sub get_headref ($) {
my $name = shift;
$name =~ s/'/'\\''/;
$name =~ s/'/'\\''/g;
my $r = `git rev-parse --verify '$name' 2>/dev/null`;
return undef unless $? == 0;
chomp $r;