From 3410fdc42075bd788a78f4b2a68c5e2cc0930409 Mon Sep 17 00:00:00 2001 From: Jon Nordby Date: Sun, 28 Jun 2009 14:17:19 +0200 Subject: implemented equality operations on Commit objects --- lib/git/commit.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/git/commit.py') diff --git a/lib/git/commit.py b/lib/git/commit.py index 2b19ea42..2bd78b75 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -67,6 +67,12 @@ class Commit(LazyMixin): if tree is not None: self.tree = Tree(repo, id=tree) + def __eq__(self, other): + return self.id == other.id + + def __ne__(self, other): + return self.id != other.id + def __bake__(self): temp = Commit.find_all(self.repo, self.id, max_count=1)[0] self.parents = temp.parents -- cgit v1.2.1