libgit2/libgit2 — pull request #1222 by scunz (2013-01-11 02:12:40+00:00)
Title: Switch to specified branch during clone

This PR adds the `checkout_branch` member to the `git_clone_options` and implements switching to that branch (before checkout), if it is given.

If there is no `remotes//`-ref, the clone operation fails. That is analog to the behaviour of `git clone -b foo `, if `foo` cannot be resolved.

`git clone -b 1234` creates a detached head, if `1234` is a tag or a SHA1. _That is not implemented here_.