Since there is no copy-paste example for getting last commit with libgit2 I thought I should add one. The examples in libgit2 make extensive use of git_oid_fromstr()
...
Don't forget that libgit2 is in full development at this time (March 2013) so have a look at official documentation and source code, as new features are added daily:
- liggit2 API
- headers are very well commented - here's an example
- extensive tests may be a source of inspiration
- there are some official examples, general.c is a good place to start
- inspiration may be found in LibGit2Sharp - here are some tests