Skip to content

Commit 8c87bdf

Browse files
peffgitster
authored andcommitted
cvsimport: apply shell-quoting regex globally
Commit 5b4efea (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: <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5b4efea commit 8c87bdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-cvsimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ sub is_sha1 {
642642

643643
sub get_headref ($) {
644644
my $name = shift;
645-
$name =~ s/'/'\\''/;
645+
$name =~ s/'/'\\''/g;
646646
my $r = `git rev-parse --verify '$name' 2>/dev/null`;
647647
return undef unless $? == 0;
648648
chomp $r;

0 commit comments

Comments
 (0)