git-remote-mediawiki: get rid of O(N^2) loop