git-remote-mediawiki: change the behaviour of a split
[gitweb.git] / contrib / mw-to-git / git-remote-mediawiki.perl
index 3d1a324cf936b0cca4d3c0394a6dcb6840574f42..74344f63dbe55cfc58f26e6b1749a49d63a03b38 100755 (executable)
@@ -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;
@@ -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 ]+)/) {
-                               foreach my $parent (split(' ', $parents)) {
+                       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";
                        }
                }
@@ -1333,7 +1333,8 @@ sub get_mw_namespace_id {
 }
 
 sub get_mw_namespace_id_for_page {
-       if (my ($namespace) = $_[0] =~ /^([^:]*):/) {
+       my $namespace = shift;
+       if ($namespace =~ /^([^:]*):/) {
                return get_mw_namespace_id($namespace);
        } else {
                return;