Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-08-10 21:01:19 +0300
committerJunio C Hamano <gitster@pobox.com>2021-08-10 21:01:19 +0300
commit59dcbb810c30967139ff1784f42c85f50a81b31c (patch)
tree2d25d65d87a63e58e3ee2f081a13b6a0fb8c2b73 /git-submodule.sh
parente5a14ddd2d93da4d951fd63d4f78fe2410debe68 (diff)
parenta452128a36cb73f5366c23eabe93c7edfa227866 (diff)
Merge branch 'ar/submodule-add-config' into ar/submodule-add
* ar/submodule-add-config: submodule--helper: introduce add-config subcommand
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh28
1 files changed, 1 insertions, 27 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index dbd2ec2050..8c219ef382 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -242,33 +242,7 @@ cmd_add()
fi
git submodule--helper add-clone ${GIT_QUIET:+--quiet} ${force:+"--force"} ${progress:+"--progress"} ${branch:+--branch "$branch"} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${dissociate:+"--dissociate"} ${depth:+"$depth"} || exit
- git config submodule."$sm_name".url "$realrepo"
-
- git add --no-warn-embedded-repo $force "$sm_path" ||
- die "fatal: $(eval_gettext "Failed to add submodule '\$sm_path'")"
-
- git submodule--helper config submodule."$sm_name".path "$sm_path" &&
- git submodule--helper config submodule."$sm_name".url "$repo" &&
- if test -n "$branch"
- then
- git submodule--helper config submodule."$sm_name".branch "$branch"
- fi &&
- git add --force .gitmodules ||
- die "fatal: $(eval_gettext "Failed to register submodule '\$sm_path'")"
-
- # NEEDSWORK: In a multi-working-tree world, this needs to be
- # set in the per-worktree config.
- if git config --get submodule.active >/dev/null
- then
- # If the submodule being adding isn't already covered by the
- # current configured pathspec, set the submodule's active flag
- if ! git submodule--helper is-active "$sm_path"
- then
- git config submodule."$sm_name".active "true"
- fi
- else
- git config submodule."$sm_name".active "true"
- fi
+ git submodule--helper add-config ${force:+--force} ${branch:+--branch "$branch"} --url "$repo" --resolved-url "$realrepo" --path "$sm_path" --name "$sm_name"
}
#