Wrap and introduce get_entry_by_oid #151

Merged
merged 2 commits into from Dec 30, 2012

Projects

None yet

2 participants

@tnm
Member
tnm commented Dec 30, 2012

This adds get_entry_by_oid, which returns a hash entry from a tree, based off the oid sha (instead of index or filename, like plain get_entry). I set this as its own method for clarity and especially because this method has different performance characteristics from get_entry; in theory we could fold it into get_entry if we wanted, but I do like this approach for now.

Added three unit tests, confirming correct behavior when given a non-existent oid or when given a non-string argument.

cc @vmg

tnm added some commits Dec 30, 2012
@tnm tnm Introduce get_entry_by_oid.
Based on non-trivial differences in performance
between this method and ordinary get_entry, it
has been set as its own method.
4968725
@tnm tnm Add a test for the nil case c5de6a9
@vmg vmg merged commit 47678c7 into libgit2:development Dec 30, 2012

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment