git-remote-mediawiki: rewrite unclear line of instructions
authorCélestin Matte <celestin.matte@ensimag.fr>
Fri, 14 Jun 2013 13:50:15 +0000 (15:50 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2013 16:02:16 +0000 (09:02 -0700)
Subroutines' parameters should be assigned to variable before doing anything
else
Besides, existing instruction affected a variable inside a "if", which break
Git's coding style

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>
contrib/mw-to-git/git-remote-mediawiki.perl
index 3d1a324cf936b0cca4d3c0394a6dcb6840574f42..5e0083304094d7658701910410cf05b55bf06c8f 100755 (executable)
@@ -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;