Fix the build for git repositories with multiple remotes.