Clone git repo with branch if specified instead of checkout

Please fix indentation.