libgit2/rugged — pull request #133 by vmg (2012-12-14 15:38:13+00:00)
Title: More Ruby-like object passing on the API

This PR changes the old `rugged_object_get` and `rugged_oid_get` so their string -> object conversions are not limited to OIDs, but to any string that revparse can process (e.g. a reference, or something like `HEAD~2`). This will automatically propagate to the whole external API.

There is a fastpath in both functions, so if you throw in a 40-character string, we perform a quick OID conversion instead of trying a full revparse. When you pass a native Rugged::Object, we still just fetch the internal object, so the function should be just as fast on 99% of the use cases, while adding a ton of versatility to the API.

/cc @spraints: this is what I had in mind for your PR, plus it also makes the old `rugged_object_get` equally as lax
/cc @scottjg @brianmario