Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap and introduce get_entry_by_oid #151

Merged
merged 2 commits into from Dec 30, 2012
Merged

Conversation

tnm
Copy link
Contributor

@tnm 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

Based on non-trivial differences in performance
between this method and ordinary get_entry, it
has been set as its own method.
vmg pushed a commit that referenced this pull request Dec 30, 2012
Wrap and introduce get_entry_by_oid
@vmg vmg merged commit 47678c7 into libgit2:development Dec 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants