summaryrefslogtreecommitdiff
path: root/lib/git/objects/submodule/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-20 20:46:21 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-20 20:46:21 +0100
commitca3fdbe2232ceb2441dedbec1b685466af95e73b (patch)
treedf7913bffd529f431b6a035eac634b110533b4d3 /lib/git/objects/submodule/base.py
parent8f24f9540afc0db61d197bc4932697737bff1506 (diff)
downloadgitpython-ca3fdbe2232ceb2441dedbec1b685466af95e73b.tar.gz
submodule.update: now forcing the checkout - see in-code comments
Diffstat (limited to 'lib/git/objects/submodule/base.py')
-rw-r--r--lib/git/objects/submodule/base.py6
1 files changed, 5 insertions, 1 deletions
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