Skip to content

Commit 96653ce

Browse files
simon04gitster
authored andcommitted
remote-mediawiki: fix duplicate revisions being imported
Fix a bug with revisions being imported twice. This commit is being backported from Git-Mediawiki.git's e41ee9b ("All revisions imported twice", 2018-02-02) to git.git. See [1] for the original commit and [2] and [3] for the upstream PR and issue. 1. Git-Mediawiki/Git-Mediawiki@e41ee9b 2. Git-Mediawiki/Git-Mediawiki#61 3. Git-Mediawiki/Git-Mediawiki#29 Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d42b4d commit 96653ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ sub get_more_refs {
807807
sub mw_import {
808808
# multiple import commands can follow each other.
809809
my @refs = (shift, get_more_refs('import'));
810+
my $processedRefs;
810811
foreach my $ref (@refs) {
812+
next if $processedRefs->{$ref}; # skip duplicates: "import refs/heads/master" being issued twice; TODO: why?
813+
$processedRefs->{$ref} = 1;
811814
mw_import_ref($ref);
812815
}
813816
print {*STDOUT} "done\n";

0 commit comments

Comments
 (0)