mirror of
https://github.com/git/git.git
synced 2025-04-25 09:53:07 +00:00
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>
This commit is contained in:
parent
eb96b75039
commit
1149957368
@ -1168,7 +1168,7 @@ sub mw_push_revision {
|
||||
my %local_ancestry;
|
||||
foreach my $line (@local_ancestry) {
|
||||
if (my ($child, $parents) = $line =~ /^-?([a-f0-9]+) ([a-f0-9 ]+)/) {
|
||||
foreach my $parent (split(' ', $parents)) {
|
||||
foreach my $parent (split(/ /, $parents)) {
|
||||
$local_ancestry{$parent} = $child;
|
||||
}
|
||||
} elsif (!$line =~ /^([a-f0-9]+)/) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user