Fix ref comparison.

In the case of ref deletion, the null sha is not very
unique, and could be present in another project.  Make
sure to compare the project, ref, and sha to determine
if two ref-updated events are equal.

Change-Id: I6bd4a02f21bd31b91ef369783641ded014f7717c
Reviewed-on: https://review.openstack.org/13839
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2012-09-28 08:29:39 -07:00 committed by Jenkins
parent 9b670905d9
commit 9358c615f9

View File

@ -507,7 +507,9 @@ class Ref(Changeish):
return self.newrev
def equals(self, other):
if self.ref == other.ref and self.newrev == other.newrev:
if (self.project == other.project
and self.ref == other.ref
and self.newrev == other.newrev):
return True
return False