diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-26 17:48:01 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-26 17:48:01 +0100 |
commit | 7ef66a66dc52dcdf44cebe435de80634e1beb268 (patch) | |
tree | c5923e0c2eed7e8453adb14f44fe64ea72d2f29b /lib/git/objects/commit.py | |
parent | fa98250e1dd7f296b36e0e541d3777a3256d676c (diff) | |
download | gitpython-7ef66a66dc52dcdf44cebe435de80634e1beb268.tar.gz |
objects.utils: Added Traversable base and implemented it for commits including a test
Diffstat (limited to 'lib/git/objects/commit.py')
-rw-r--r-- | lib/git/objects/commit.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py index c7824ca6..bb458921 100644 --- a/lib/git/objects/commit.py +++ b/lib/git/objects/commit.py @@ -13,7 +13,7 @@ import utils import tempfile import os -class Commit(base.Object, Iterable, diff.Diffable): +class Commit(base.Object, Iterable, diff.Diffable, utils.Traversable): """ Wraps a git Commit object. @@ -74,6 +74,10 @@ class Commit(base.Object, Iterable, diff.Diffable): if self.sha and tree is not None: self.tree = Tree(repo, tree, path='') # END id to tree conversion + + @classmethod + def _get_intermediate_items(cls, commit): + return commit.parents def _set_cache_(self, attr): """ |