From: Francesco Pretto Date: Sun, 05 Jan 2014 02:50:48 GMT Subject: [PATCH 1/2] git-submodule.sh: Support 'checkout' as a valid update command Message-ID: <1388890249-3577-1-git-send-email-ceztko@gmail.com> According to "Documentation/gitmodules.txt", 'checkout' is a valid 'submodule..update' command. Also "git-submodule.sh" refers to it and processes it correctly. Reflect commit 'ac1fbb' to support this syntax and also validates property values during 'update' command, issuing a warning if the value found is unknwon. --- git-submodule.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 2677f2e..1d041a7 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,18 @@ 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 + *) + update_module= + echo >&2 "warning: invalid update mode for submodule '$name'" + ;; + esac fi displaypath=$(relative_path "$prefix$sm_path") -- 1.8.5.2.230.g032cd47.dirty