git-remote-mediawiki: remove useless regexp modifier (m)
m// and // is used randomly. It is better to use the m modifier only when needed, e.g., when the regexp uses another separator than //. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Célestin Matte committed
Jun 14, 2013 at 15:50 UTC
eb96b750394a78d9317f0a9224689f1ef50f04ec
1 file changed
+3
-3
contrib/mw-to-git/git-remote-mediawiki.perl
+3
-3
@@ -761,7 +761,7 @@ sub get_more_refs {
761
my @refs;
762
while (1) {
763
my $line = <STDIN>;
764
- if ($line =~ m/^$cmd (.*)$/) {
764
+ if ($line =~ /^$cmd (.*)$/) {
765
push(@refs, $1);
766
} elsif ($line eq "\n") {
767
return @refs;
@@ -1167,11 +1167,11 @@ sub mw_push_revision {
1167
my @local_ancestry = split(/\n/, run_git("rev-list --boundary --parents $local ^$parsed_sha1"));
1168
my %local_ancestry;
1169
foreach my $line (@local_ancestry) {
1170
- if (my ($child, $parents) = $line =~ m/^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
1170
+ if (my ($child, $parents) = $line =~ /^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
1171
foreach my $parent (split(' ', $parents)) {
1172
$local_ancestry{$parent} = $child;
1173
}
1174
- } elsif (!$line =~ m/^([a-f0-9]+)/) {
1174
+ } elsif (!$line =~ /^([a-f0-9]+)/) {
1175
die "Unexpected output from git rev-list: $line";
1176
}
1177
}