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>

Jeff King committed Dec 8, 2017 at 04:58 UTC 8c87bdfb2137c9e9e945df13e2f2e1eb995ddf83
1 file changed +1 -1
git-cvsimport.perl
+1 -1
@@ -642,7 +642,7 @@ sub is_sha1 {
642
643 sub get_headref ($) {
644 my $name = shift;
645 - $name =~ s/'/'\\''/;
645 + $name =~ s/'/'\\''/g;
646 my $r = `git rev-parse --verify '$name' 2>/dev/null`;
647 return undef unless $? == 0;
648 chomp $r;