summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:51 (GMT)
commit4d6d6ef1fcce0e7d1fd2d3d38c2372998a105e96 (patch)
treecb82c3f9f48a15e4587de3631d67304616090895 /git-submodule.sh
parent39006893f9fce70d8d2fe055e4285e1fca0ca050 (diff)
parentee69b2a90c5031bffb3341c5e50653a6ecca89ac (diff)
downloadgit-4d6d6ef1fcce0e7d1fd2d3d38c2372998a105e96.zip
git-4d6d6ef1fcce0e7d1fd2d3d38c2372998a105e96.tar.gz
git-4d6d6ef1fcce0e7d1fd2d3d38c2372998a105e96.tar.bz2
Merge branch 'sb/submodule-update-in-c'
"git submodule update" is getting rewritten piece-by-piece into C. * sb/submodule-update-in-c: submodule--helper: introduce new update-module-mode helper submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree builtin/submodule--helper: factor out method to update a single submodule builtin/submodule--helper: store update_clone information in a struct builtin/submodule--helper: factor out submodule updating git-submodule.sh: rename unused variables git-submodule.sh: align error reporting for update mode to use path
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh24
1 files changed, 6 insertions, 18 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 1cb2c0a..1b568e2 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -534,31 +534,19 @@ cmd_update()
"$@" || echo "#unmatched" $?
} | {
err=
- while read -r mode sha1 stage just_cloned sm_path
+ while read -r quickabort sha1 just_cloned sm_path
do
- die_if_unmatched "$mode" "$sha1"
+ die_if_unmatched "$quickabort" "$sha1"
- name=$(git submodule--helper name "$sm_path") || exit
- if ! test -z "$update"
- then
- update_module=$update
- else
- update_module=$(git config submodule."$name".update)
- if test -z "$update_module"
- then
- update_module="checkout"
- fi
- fi
+ git submodule--helper ensure-core-worktree "$sm_path"
+
+ update_module=$(git submodule--helper update-module-mode $just_cloned "$sm_path" $update)
displaypath=$(git submodule--helper relative-path "$prefix$sm_path" "$wt_prefix")
if test $just_cloned -eq 1
then
subsha1=
- case "$update_module" in
- merge | rebase | none)
- update_module=checkout ;;
- esac
else
subsha1=$(sanitize_submodule_env; cd "$sm_path" &&
git rev-parse --verify HEAD) ||
@@ -630,7 +618,7 @@ cmd_update()
must_die_on_failure=yes
;;
*)
- die "$(eval_gettext "Invalid update mode '$update_module' for submodule '$name'")"
+ die "$(eval_gettext "Invalid update mode '$update_module' for submodule path '$path'")"
esac
if (sanitize_submodule_env; cd "$sm_path" && $command "$sha1")