diff options
author | Jon Nordby <jononor@gmail.com> | 2009-06-28 14:17:19 +0200 |
---|---|---|
committer | Jon Nordby <jononor@gmail.com> | 2009-06-28 14:17:19 +0200 |
commit | 3410fdc42075bd788a78f4b2a68c5e2cc0930409 (patch) | |
tree | 34e4e0f74a09569c16bc3d6f1ead6cc7742ddc26 /lib/git/commit.py | |
parent | 4c39f9da792792d4e73fc3a5effde66576ae128c (diff) | |
download | gitpython-3410fdc42075bd788a78f4b2a68c5e2cc0930409.tar.gz |
implemented equality operations on Commit objects
Diffstat (limited to 'lib/git/commit.py')
-rw-r--r-- | lib/git/commit.py | 6 |
1 files changed, 6 insertions, 0 deletions
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 |