summaryrefslogtreecommitdiff
path: root/git/objects/submodule/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r--git/objects/submodule/base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index f5ff457d..285d2423 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -675,6 +675,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
# rename the index entry - have to manipulate the index directly as
# git-mv cannot be used on submodules ... yeah
+ previous_sm_path = self.path
try:
if configuration:
try:
@@ -701,6 +702,11 @@ class Submodule(util.IndexObject, Iterable, Traversable):
raise
# END handle undo rename
+ # Auto-rename submodule if it's name was 'default', that is, the checkout directory
+ if previous_sm_path == self.name:
+ self.rename(module_checkout_path)
+ # end
+
return self
@unbare_repo