зеркало из https://github.com/microsoft/git.git
git-remote-mediawiki: make a regexp clearer
Perl's split function takes a regex pattern argument. You can also feed it an expression, which is then compiled into a regex at runtime. It therefore works to pass your pattern via single quotes, but it is much less obvious to a reader that the argument is meant to be a regex, not a static string. Using the traditional slash-delimiters makes this easier to read. 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:
Родитель
bdff0e3a37
Коммит
05d4c7b1c4
|
@ -1170,7 +1170,7 @@ sub mw_push_revision {
|
||||||
# history (linearized with --first-parent)
|
# history (linearized with --first-parent)
|
||||||
print STDERR "Warning: no common ancestor, pushing complete history\n";
|
print STDERR "Warning: no common ancestor, pushing complete history\n";
|
||||||
my $history = run_git("rev-list --first-parent --children $local");
|
my $history = run_git("rev-list --first-parent --children $local");
|
||||||
my @history = split('\n', $history);
|
my @history = split(/\n/, $history);
|
||||||
@history = @history[1..$#history];
|
@history = @history[1..$#history];
|
||||||
foreach my $line (reverse @history) {
|
foreach my $line (reverse @history) {
|
||||||
my @commit_info_split = split(/ |\n/, $line);
|
my @commit_info_split = split(/ |\n/, $line);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче