aboutsummaryrefslogtreecommitdiffstats
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-03 11:25:19 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-03 11:25:19 -0800
commit4ba6bb2d1792bd799b295b879461ee5453faab3e (patch)
tree9eb86f7653c76d38c176847bf585feaa2208768a /git-submodule.sh
parent5348021c6750bc22778705a454e4c6ad85414245 (diff)
parente7b37caf4feace4ee799570285b4699b23e0581f (diff)
downloadgit-4ba6bb2d1792bd799b295b879461ee5453faab3e.tar.gz
Merge branch 'sb/submodule-update-initial-runs-custom-script'
The user can specify a custom update method that is run when "submodule update" updates an already checked out submodule. This was ignored when checking the submodule out for the first time and we instead always just checked out the commit that is bound to the path in the superproject's index. * sb/submodule-update-initial-runs-custom-script: submodule update: run custom update script for initial populating as well
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 123ac104c6..136e26a2c8 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -613,7 +613,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) ||