diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 | 
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 | 
| commit | 9ee31065abea645cbc2cf3e54b691d5983a228b2 (patch) | |
| tree | 21e38d54e5a69d2983906f6ac30e6322ed9a7ef1 /lib/git/tree.py | |
| parent | 8430529e1a9fb28d8586d24ee507a8195c370fa5 (diff) | |
| download | gitpython-9ee31065abea645cbc2cf3e54b691d5983a228b2.tar.gz | |
Intermediate commit: commit,tree and blob objects now derive from object - test is in place which still fails on purpose. Need to integrate tags which can be objects or just a special form of a ref
Diffstat (limited to 'lib/git/tree.py')
| -rw-r--r-- | lib/git/tree.py | 17 | 
1 files changed, 7 insertions, 10 deletions
| diff --git a/lib/git/tree.py b/lib/git/tree.py index 06c1a158..6215f875 100644 --- a/lib/git/tree.py +++ b/lib/git/tree.py @@ -5,25 +5,22 @@  # the BSD License: http://www.opensource.org/licenses/bsd-license.php  import os -from base import LazyMixin  import blob +import base -class Tree(LazyMixin): +class Tree(base.Object): +     +    type = "tree" +          def __init__(self, repo, id, mode=None, path=None): -        LazyMixin.__init__(self) -        self.repo = repo -        self.id = id +        super(Tree, self).__init__(repo, id)          self.mode = mode          self.path = path          self._contents = None      def __bake__(self): -        # Ensure the treeish references directly a tree -        treeish = self.id -        if not treeish.endswith(':'): -            treeish = treeish + ':' -          # Read the tree contents. +        super(Tree, self).__bake__()          self._contents = {}          for line in self.repo.git.ls_tree(self.id).splitlines():              obj = self.content_from_string(self.repo, line) | 
