Skip to content

Commit 300819c

Browse files
authored
Merge pull request gitpython-developers#679 from jakirkham/fix_create_submodule
Store submodule name
2 parents 8a24ccb + 8321985 commit 300819c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: git/objects/submodule/base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ def add(cls, repo, name, path, url=None, branch=None, no_checkout=False):
358358
if sm.exists():
359359
# reretrieve submodule from tree
360360
try:
361-
return repo.head.commit.tree[path]
361+
sm = repo.head.commit.tree[path]
362+
sm._name = name
363+
return sm
362364
except KeyError:
363365
# could only be in index
364366
index = repo.index

0 commit comments

Comments
 (0)