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

Add tree_at similar to blob_at #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add tree_at similar to blob_at #453

wants to merge 1 commit into from

Conversation

sarupbanskota
Copy link

I was wondering if a tree_at method would be useful (similar to the blob_at? (I'm only recently exploring rugged's source, so I could be wrong). It's not a lot of effort doing that otherwise, but a method for that could keep things easy.

There isn't much error handling atm.

# Returns a String.
def tree_at(revision, path)
tree = Rugged::Commit.lookup(self, revision).tree
tree.path(path)[:oid]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this is implemented right now, #tree_at would return the tree's oid, not the actual Rugged::Tree object. This is different from how #blob_at works.

Would you mind fixing this up and adding some test cases?

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.

2 participants