summaryrefslogtreecommitdiff
path: root/git/objects/tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/objects/tree.py')
-rw-r--r--git/objects/tree.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/git/objects/tree.py b/git/objects/tree.py
index 6776a15e..f9bee01e 100644
--- a/git/objects/tree.py
+++ b/git/objects/tree.py
@@ -159,7 +159,7 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
raise TypeError("Unknown mode %o found in tree data for path '%s'" % (mode, path))
# END for each item
- def __div__(self, file):
+ def join(self, file):
"""Find the named object in this tree's contents
:return: ``git.Blob`` or ``git.Tree`` or ``git.Submodule``
@@ -192,6 +192,14 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
raise KeyError(msg % file)
# END handle long paths
+ def __div__(self, file):
+ """For PY2 only"""
+ return self.join(file)
+
+ def __truediv__(self, file):
+ """For PY3 only"""
+ return self.join(file)
+
@property
def trees(self):
""":return: list(Tree, ...) list of trees directly below this tree"""
@@ -235,7 +243,7 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
if isinstance(item, string_types):
# compatability
- return self.__div__(item)
+ return self.join(item)
# END index is basestring
raise TypeError("Invalid index type: %r" % item)