summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorStefan Zager <szager@google.com>2012-07-25 10:41:54 -0700
committerJunio C Hamano <gitster@pobox.com>2012-08-24 09:00:43 -0700
commit01d4721565f1562172149ebb91d29d6a7e7f922d (patch)
tree6ce6aaf48e78dc3de1a0983206a7eeb4370ad182 /git-submodule.sh
parente6dfbcf12b0e70897818cb36903de0625931a5c6 (diff)
downloadgit-01d4721565f1562172149ebb91d29d6a7e7f922d.tar.gz
Make 'git submodule update --force' always check out submodules.
Currently, it will only do a checkout if the sha1 registered in the containing repository doesn't match the HEAD of the submodule, regardless of whether the submodule is dirty. As discussed on the mailing list, the '--force' flag is a strong indicator that the state of the submodule is suspect, and should be reset to HEAD. Signed-off-by: Stefan Zager <szager@google.com> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index fbf2fafaaf..812a60fe4c 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -537,7 +537,7 @@ Maybe you want to use 'update --init'?")"
die "$(eval_gettext "Unable to find current revision in submodule path '\$sm_path'")"
fi
- if test "$subsha1" != "$sha1"
+ if test "$subsha1" != "$sha1" -o -n "$force"
then
subforce=$force
# If we don't already have a -f flag and the submodule has never been checked out