summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorJohn Kirkham <kirkhamj@janelia.hhmi.org>2017-10-01 22:27:52 -0400
committerJohn Kirkham <kirkhamj@janelia.hhmi.org>2017-10-01 22:27:52 -0400
commitf2b820f936132d460078b47e8de72031661f848c (patch)
tree0791bc13ac54f8ec23a808ae3adaeb57a2dbcd34 /git
parentd2ce49598a25b48ad0ab38cc1101c5e2a42a918e (diff)
downloadgitpython-f2b820f936132d460078b47e8de72031661f848c.tar.gz
Store submodule name
Diffstat (limited to 'git')
-rw-r--r--git/objects/submodule/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index a6b4caed..dc4ee3c6 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -358,7 +358,9 @@ class Submodule(IndexObject, Iterable, Traversable):
if sm.exists():
# reretrieve submodule from tree
try:
- return repo.head.commit.tree[path]
+ sm = repo.head.commit.tree[path]
+ sm._name = name
+ return sm
except KeyError:
# could only be in index
index = repo.index