Fix updating of branches in mirrored repository

Merged Douwe Maan requested to merge fix-mirror into master