Skip to content

Commit

Permalink
All revisions imported twice
Browse files Browse the repository at this point in the history
For a `git clone` strangely, `import refs/heads/master` is sent twice.
Fix/workaround: skip duplicate refs in `mw_import`.
  • Loading branch information
simon04 authored and moy committed Feb 8, 2018
1 parent c446bf3 commit e41ee9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-remote-mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,10 @@ sub get_more_refs {
sub mw_import {
# multiple import commands can follow each other.
my @refs = (shift, get_more_refs('import'));
my $processedRefs;
foreach my $ref (@refs) {
next if $processedRefs->{$ref}; # skip duplicates: "import refs/heads/master" being issued twice; TODO: why?
$processedRefs->{$ref} = 1;
mw_import_ref($ref);
}
print {*STDOUT} "done\n";
Expand Down

0 comments on commit e41ee9b

Please sign in to comment.