git-remote-mediawiki: change the behaviour of a split
A "split ' '" is turned into a "split / /", which changes its behaviour: the old method matched a run of whitespaces (/\s*/), while the new one will match a single space, which is what we want here. Indeed, in other contexts, changing split(' ') to split(/ /) could potentially be a regression, however, here, when parsing the output of "rev-list --parents", whose output SHA-1's are each separated by a single space, splitting on a single space is perfectly correct. 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
1149957368ef29b6a05ad5cf93f6c62352136bcd
1 file changed
+1
-1
contrib/mw-to-git/git-remote-mediawiki.perl
+1
-1
@@ -1168,7 +1168,7 @@ sub mw_push_revision {
1168
my %local_ancestry;
1169
foreach my $line (@local_ancestry) {
1170
if (my ($child, $parents) = $line =~ /^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
1171
- foreach my $parent (split(' ', $parents)) {
1171
+ foreach my $parent (split(/ /, $parents)) {
1172
$local_ancestry{$parent} = $child;
1173
}
1174
} elsif (!$line =~ /^([a-f0-9]+)/) {