Skip to content

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