Detect single remote and use it by default

This is a situation I frequently find myself in. As a result of cheking out a bunch of projects with git-repo I have a single remote in my git repository called, say, gitlab (as per the manifest; the default remote's name is basically controlled by its author).

How about adding the ingelligence to do the right thing for a single remote while preserving the old behavior?

I.e. if a remote is supplied as the second argument, use that, otherwise use origin if it exists, but if it doesn't and git remote returns a signle value, then use that, and finally, fail otherwise.