diff options
Diffstat (limited to 'lib/git/commit.py')
-rw-r--r-- | lib/git/commit.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/git/commit.py b/lib/git/commit.py index 1cb863ca..edfe47ca 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -73,6 +73,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): """ Called by LazyMixin superclass when the first uninitialized member needs @@ -126,6 +132,7 @@ class Commit(LazyMixin): def find_all(cls, repo, ref, path='', **kwargs): """ Find all commits matching the given criteria. + ``repo`` is the Repo @@ -164,7 +171,7 @@ class Commit(LazyMixin): Returns git.Commit[] """ - lines = [l for l in text.splitlines() if l.strip()] + lines = [l for l in text.splitlines() if l.strip('\r\n')] commits = [] |