summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules6
-rw-r--r--lib/git/objects/submodule/base.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules
index 3e84903d..3560dc4e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "gitdb"]
- path = lib/git/ext/gitdb
- url = git://gitorious.org/git-python/gitdb.git
+[submodule "gitdb"]
+ path = lib/git/ext/gitdb
+ url = git://gitorious.org/git-python/gitdb.git
diff --git a/lib/git/objects/submodule/base.py b/lib/git/objects/submodule/base.py
index 7cc47e4b..e9493820 100644
--- a/lib/git/objects/submodule/base.py
+++ b/lib/git/objects/submodule/base.py
@@ -387,7 +387,11 @@ class Submodule(util.IndexObject, Iterable, Traversable):
# update the working tree
if mrepo.head.commit.binsha != binsha:
if is_detached:
- mrepo.git.checkout(hexsha)
+ # NOTE: for now we force, the user is no supposed to change detached
+ # submodules anyway. Maybe at some point this becomes an option, to
+ # properly handle user modifications - see below for future options
+ # regarding rebase and merge.
+ mrepo.git.checkout(hexsha, force=True)
else:
# TODO: allow to specify a rebase, merge, or reset
# TODO: Warn if the hexsha forces the tracking branch off the remote