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

TreeEntry equality testing #458

Closed
ssadler opened this issue Dec 7, 2014 · 2 comments
Closed

TreeEntry equality testing #458

ssadler opened this issue Dec 7, 2014 · 2 comments

Comments

@ssadler
Copy link

ssadler commented Dec 7, 2014

So I am comparing 2 different versions of a TreeEntry at the same path in my repository, and the equality test returns True even though they have different OIDs. Just pointing it out, it wasn't hard to find but it seems counter intuitive to me.

(Pdb) (item1.oid, item2.oid)
(d21644a6c7570de018ea623d37732b8e549218ec, c9f6f5428e80fb5d3954ccf0ae2ca24c1c999f53)
(Pdb) (item1.name, item2.name)
('tx', 'tx')
(Pdb) item1 == item2
True

Otherwise, thanks for the great lib!

@carlosmn
Copy link
Member

carlosmn commented Feb 7, 2015

It's a bit unfortunate that we use git_tree_entry_cmp() for equality, since that's not what the function is meant to do. It is instead meant for sorting in a git-compatible manner and as such only checks for the name and the filemode, as that's what the sorting needs to do.

@jdavid
Copy link
Member

jdavid commented Mar 16, 2015

I understand this is fixed now PR #488 has been merged.

@ssadler reopen if you still have issues.

@jdavid jdavid closed this as completed Mar 16, 2015
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

No branches or pull requests

3 participants