libgit2/libgit2 — pull request #1937 by scunz (2013-11-02 03:54:10+00:00)
Title: Don't assert in git_checkout_tree

According to the first error message in `git_checkout_tree`, it is valid to pass _either_ a repository or a treeish to it. However, it does just assert in the case that treeish was passed as `NULL`.

This patch changes
- the git_checkout signatures to all use a `const` opts parameter
- use HEAD when no treeish is given to `git_checkout_tree`
- reimplement `git_checkout_head` on top of that.