diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 18:06:18 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 18:06:18 +0200 |
commit | 7a7eedde7f5d5082f7f207ef76acccd24a6113b1 (patch) | |
tree | f17c4534f0af534499503d2111e746a961bbb370 /lib/git/tree.py | |
parent | 101fb1df36f29469ee8f4e0b9e7846d856b87daa (diff) | |
download | gitpython-7a7eedde7f5d5082f7f207ef76acccd24a6113b1.tar.gz |
put Tree and Blob onto a new base class suitable to deal with IndexObjects
Diffstat (limited to 'lib/git/tree.py')
-rw-r--r-- | lib/git/tree.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/git/tree.py b/lib/git/tree.py index 3d4deb16..90f1b72d 100644 --- a/lib/git/tree.py +++ b/lib/git/tree.py @@ -8,14 +8,13 @@ import os import blob import base -class Tree(base.Object): +class Tree(base.IndexObject): type = "tree" + __slots__ = "_contents" - def __init__(self, repo, id, mode=None, path=None): - super(Tree, self).__init__(repo, id) - self.mode = mode - self.path = path + def __init__(self, repo, id, mode=None, path=None, size=None): + super(Tree, self).__init__(repo, id, mode, path, size) self._contents = None def __bake__(self): @@ -71,9 +70,6 @@ class Tree(base.Object): """ return self.get(file) - @property - def basename(self): - os.path.basename(self.path) def __repr__(self): return '<git.Tree "%s">' % self.id |