From e7b37caf4feace4ee799570285b4699b23e0581f Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Wed, 25 Jan 2017 15:48:51 -0800 Subject: submodule update: run custom update script for initial populating as well In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned, 2011-02-17), all actions were defaulted to checkout for populating a submodule initially, because merging or rebasing makes no sense in that situation. Other commands however do make sense, such as the custom command that was added later (6cb5728c43, submodule update: allow custom command to update submodule working tree, 2013-07-03). I am unsure about the "none" command, as I can see an initial checkout there as a useful thing. On the other hand going strictly by our own documentation, we should do nothing in case of "none" as well, because the user asked for it. Reported-by: Han-Wen Nienhuys Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- git-submodule.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index b57f87de65..f1d3324be9 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -605,7 +605,10 @@ cmd_update() if test $just_cloned -eq 1 then subsha1= - update_module=checkout + case "$update_module" in + merge | rebase | none) + update_module=checkout ;; + esac else subsha1=$(sanitize_submodule_env; cd "$sm_path" && git rev-parse --verify HEAD) || -- cgit v1.2.3