summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-17 20:21:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-17 20:21:20 (GMT)
commit1aeb10a14d5ecf5a10a4536b873c9feb244a7848 (patch)
tree5e5953867a1f038da8bd525c55b1f2d888e0841f /git-submodule.sh
parent92251b1b5b5e53ac9de890105e2a2bd9d15e2ecb (diff)
parentefa8fd7ee8eb36df55b3549f6009f000347a796d (diff)
downloadgit-1aeb10a14d5ecf5a10a4536b873c9feb244a7848.zip
git-1aeb10a14d5ecf5a10a4536b873c9feb244a7848.tar.gz
git-1aeb10a14d5ecf5a10a4536b873c9feb244a7848.tar.bz2
Merge branch 'fp/submodule-checkout-mode'
"submodule.*.update=checkout", when propagated from .gitmodules to .git/config, turned into a "submodule.*.update=none", which did not make much sense. * fp/submodule-checkout-mode: git-submodule.sh: 'checkout' is a valid update mode
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 2677f2e..4a30087 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -622,7 +622,7 @@ cmd_init()
test -z "$(git config submodule."$name".update)"
then
case "$upd" in
- rebase | merge | none)
+ checkout | rebase | merge | none)
;; # known modes of updating
*)
echo >&2 "warning: unknown update mode '$upd' suggested for submodule '$name'"
@@ -805,6 +805,17 @@ cmd_update()
update_module=$update
else
update_module=$(git config submodule."$name".update)
+ case "$update_module" in
+ '')
+ ;; # Unset update mode
+ checkout | rebase | merge | none)
+ ;; # Known update modes
+ !*)
+ ;; # Custom update command
+ *)
+ die "$(eval_gettext "Invalid update mode '$update_module' for submodule '$name'")"
+ ;;
+ esac
fi
displaypath=$(relative_path "$prefix$sm_path")