diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/git/objects/base.py | 2 | ||||
-rw-r--r-- | lib/git/objects/commit.py | 4 | ||||
-rw-r--r-- | lib/git/objects/tag.py | 2 | ||||
-rw-r--r-- | lib/git/objects/tree.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/git/objects/base.py b/lib/git/objects/base.py index d3e0d943..9789d72a 100644 --- a/lib/git/objects/base.py +++ b/lib/git/objects/base.py @@ -121,7 +121,7 @@ class IndexObject(Object): self.mode = self._mode_str_to_int(mode) def _set_cache_(self, attr): - if attr in self.__slots__: + if attr in IndexObject.__slots__: # they cannot be retrieved lateron ( not without searching for them ) raise AttributeError( "path and mode attributes must have been set during %s object creation" % type(self).__name__ ) else: diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py index 340686ea..69fb3710 100644 --- a/lib/git/objects/commit.py +++ b/lib/git/objects/commit.py @@ -71,7 +71,7 @@ class Commit(base.Object, Iterable): # END for each parent to convert if self.id and tree is not None: - self.tree = Tree(repo, id=tree) + self.tree = Tree(repo, id=tree, path='') # END id to tree conversion def _set_cache_(self, attr): @@ -80,7 +80,7 @@ class Commit(base.Object, Iterable): to be set. We set all values at once. """ - if attr in self.__slots__: + if attr in Commit.__slots__: temp = Commit.list_items(self.repo, self.id, max_count=1)[0] self.parents = temp.parents self.tree = temp.tree diff --git a/lib/git/objects/tag.py b/lib/git/objects/tag.py index 261d835f..77d715c7 100644 --- a/lib/git/objects/tag.py +++ b/lib/git/objects/tag.py @@ -48,7 +48,7 @@ class TagObject(base.Object): """ Cache all our attributes at once """ - if attr in self.__slots__: + if attr in TagObject.__slots__: output = self.repo.git.cat_file(self.type,self.id) lines = output.split("\n") diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py index 1bc35d95..01dfb37b 100644 --- a/lib/git/objects/tree.py +++ b/lib/git/objects/tree.py @@ -29,7 +29,7 @@ class Tree(base.IndexObject): type = "tree" __slots__ = "_cache" - def __init__(self, repo, id, mode=None, path=None): + def __init__(self, repo, id, mode=0, path=None): super(Tree, self).__init__(repo, id, mode, path) def _set_cache_(self, attr): |