Skip to content

Commit b8b4e1b

Browse files
Perdugitster
authored andcommitted
git-remote-mediawiki: replace "unless" statements with negated "if" statements
Signed-off-by: Célestin Matte <[email protected]> Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e83d36b commit b8b4e1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/mw-to-git/git-remote-mediawiki.perl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@
8282
# - by_rev: perform one query per new revision on the remote wiki
8383
# - by_page: query each tracked page for new revision
8484
my $fetch_strategy = run_git("config --get remote.${remotename}.fetchStrategy");
85-
unless ($fetch_strategy) {
85+
if (!$fetch_strategy) {
8686
$fetch_strategy = run_git('config --get mediawiki.fetchStrategy');
8787
}
8888
chomp($fetch_strategy);
89-
unless ($fetch_strategy) {
89+
if (!$fetch_strategy) {
9090
$fetch_strategy = 'by_page';
9191
}
9292

@@ -108,7 +108,7 @@
108108
# deterministic, this means everybody gets the same sha1 for each
109109
# MediaWiki revision.
110110
my $dumb_push = run_git("config --get --bool remote.${remotename}.dumbPush");
111-
unless ($dumb_push) {
111+
if (!$dumb_push) {
112112
$dumb_push = run_git('config --get --bool mediawiki.dumbPush');
113113
}
114114
chomp($dumb_push);
@@ -667,7 +667,7 @@ sub fetch_mw_revisions_for_page {
667667
push(@page_revs, $page_rev_ids);
668668
$revnum++;
669669
}
670-
last unless $result->{'query-continue'};
670+
last if (!$result->{'query-continue'});
671671
$query->{rvstartid} = $result->{'query-continue'}->{revisions}->{rvstartid};
672672
}
673673
if ($shallow_import && @page_revs) {
@@ -1239,7 +1239,7 @@ sub mw_push_revision {
12391239
die("Unknown error from mw_push_file()\n");
12401240
}
12411241
}
1242-
unless ($dumb_push) {
1242+
if (!$dumb_push) {
12431243
run_git(qq(notes --ref=${remotename}/mediawiki add -f -m "mediawiki_revision: ${mw_revision}" ${sha1_commit}));
12441244
run_git(qq(update-ref -m "Git-MediaWiki push" refs/mediawiki/${remotename}/master ${sha1_commit} ${sha1_child}));
12451245
}
@@ -1320,7 +1320,7 @@ sub get_mw_namespace_id {
13201320
my $ns = $namespace_id{$name};
13211321
my $id;
13221322

1323-
unless (defined $ns) {
1323+
if (!defined $ns) {
13241324
print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
13251325
$ns = {is_namespace => 0};
13261326
$namespace_id{$name} = $ns;

0 commit comments

Comments
 (0)