Correct the cloning process: directly take the branch to clone if given.

Allows avoiding issues during the checkout.
e.g. because of submodules creation/destruction.