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
This commit is contained in:
Junio C Hamano
2017-02-03 11:25:19 -08:00
2 changed files with 16 additions and 1 deletions

View File

@ -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) ||