Closed
Description
Similar to #852
References don't seem to have any sense of equality so the following happens
>>> import pygit2
>>> repo = pygit2.Repository('.')
>>> repo.references['refs/heads/master'] == repo.references['refs/heads/master']
False
This breaks container operations with Reference
objects.
Unlike objects, references are not necessarily immutable since they can be force pushed to point to a different target.
Implementing __eq__
to be based on Reference.name
makes the most sense, I think. __hash__
support does not make sense since references are mutable.