hg.clone: do not ignore branch argument when source is a repo object
This is a revert of
4a70178f9bde. The "bug" mentioned in this changeset is unclear:
hopefully using a test to cover this usage should prevent any bugs.
check-code: add exit status
so that we can use it in a shell command combination and/or in hg hooks.