Skip to content

Commit 1aeb10a

Browse files
committed
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
2 parents 92251b1 + efa8fd7 commit 1aeb10a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

git-submodule.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ cmd_init()
622622
test -z "$(git config submodule."$name".update)"
623623
then
624624
case "$upd" in
625-
rebase | merge | none)
625+
checkout | rebase | merge | none)
626626
;; # known modes of updating
627627
*)
628628
echo >&2 "warning: unknown update mode '$upd' suggested for submodule '$name'"
@@ -805,6 +805,17 @@ cmd_update()
805805
update_module=$update
806806
else
807807
update_module=$(git config submodule."$name".update)
808+
case "$update_module" in
809+
'')
810+
;; # Unset update mode
811+
checkout | rebase | merge | none)
812+
;; # Known update modes
813+
!*)
814+
;; # Custom update command
815+
*)
816+
die "$(eval_gettext "Invalid update mode '$update_module' for submodule '$name'")"
817+
;;
818+
esac
808819
fi
809820

810821
displaypath=$(relative_path "$prefix$sm_path")

0 commit comments

Comments
 (0)