Skip to content

GitPython should tolerate comparisons between None and Commits #15

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

Closed
mike-perdide opened this issue May 19, 2011 · 1 comment
Closed

Comments

@mike-perdide
Copy link

Using GitPython 0.3.1, I find myself often catching this exception :

  File "/home/mike/.virtualenvs/qgb/lib/python2.6/site-packages/GitPython-0.3.1-py2.6.egg/git/objects/base.py", line 80, in __eq__
    return self.binsha == other.binsha
AttributeError: 'NoneType' object has no attribute 'binsha'

It occurs when I try to compare a None object to a commit. I think this could be enhanced in objects/base.py by returning False if "other" has no 'binsha' attribute.

@Byron
Copy link
Member

Byron commented Jul 3, 2011

This has been implemented in 0.3 and master, and will make it into the next release, 0.3.2.

@Byron Byron closed this as completed Jul 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants