pygit2
pygit2 copied to clipboard
Example for git reset HEAD -- filename.type please
I am coming at GIT with an external view of how it works. Internals I have very little idea about.
I have figured out that I need to call repo.reset() to do the same as git reset HEAD -- filename.type.
But I have no idea how to find the OID that I need to use.
Looking at git-reset code I seem to need a treeish. How do I get a treeish that corresponds to HEAD? I guess I walk that tree looking for the filename and get a OID from the tree.