Skip to content

Commit

Permalink
git-remote-mediawiki: remove useless regexp modifier (m)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Célestin Matte authored and Junio C Hamano committed Jun 14, 2013
1 parent 6c2fbe2 commit eb96b75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/mw-to-git/git-remote-mediawiki.perl
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ sub get_more_refs {
my @refs;
while (1) {
my $line = <STDIN>;
if ($line =~ m/^$cmd (.*)$/) {
if ($line =~ /^$cmd (.*)$/) {
push(@refs, $1);
} elsif ($line eq "\n") {
return @refs;
Expand Down Expand Up @@ -1167,11 +1167,11 @@ sub mw_push_revision {
my @local_ancestry = split(/\n/, run_git("rev-list --boundary --parents $local ^$parsed_sha1"));
my %local_ancestry;
foreach my $line (@local_ancestry) {
if (my ($child, $parents) = $line =~ m/^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
if (my ($child, $parents) = $line =~ /^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
foreach my $parent (split(' ', $parents)) {
$local_ancestry{$parent} = $child;
}
} elsif (!$line =~ m/^([a-f0-9]+)/) {
} elsif (!$line =~ /^([a-f0-9]+)/) {
die "Unexpected output from git rev-list: $line";
}
}
Expand Down

0 comments on commit eb96b75

Please sign in to comment.