libgit2/libgit2 — pull request #1097 by nulltoken (2012-11-22 18:00:15+00:00)
Title: Make `git_repository_head_tree()` return error codes

Prevsiously, the function was returning `0` when
- The HEAD couldn't be resolved

**or**
- The HEAD could be resolved and a `Tree` had been found

It now returns
- `0` when everything went all right and a `Tree` has been successfully returned.
- `GIT_ENOTFOUND`when `HEAD` is missing
- `GIT_EORPHANED` when `HEAD` points at a yet to be created reference