summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
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 66f5f752c5..5247f78f35 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -617,7 +617,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'"
@@ -803,6 +803,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")