From: Jeff King Date: Fri, 8 Dec 2017 09:58:19 +0000 (-0500) Subject: cvsimport: apply shell-quoting regex globally X-Git-Tag: v2.16.0-rc0~28^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8c87bdfb2137c9e9e945df13e2f2e1eb995ddf83;p=git-core%2Fgit.git 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: Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 36929921e..2d8df8317 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -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;