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:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-06-28 13:05:31 +0300
committerJunio C Hamano <gitster@pobox.com>2022-06-28 23:13:17 +0300
commit8f12108c2951cdfa181d6be66b6def28cd007bdd (patch)
treef82b6a8e159f12d41e7878ab4acaf127a4734d8e /git-submodule.sh
parent36d45163b6de05886c2c6feb2e626ce423b96b3b (diff)
submodule--helper: understand --checkout, --merge and --rebase synonyms
Understand --checkout, --merge and --rebase synonyms for --update={checkout,merge,rebase}, as well as the short options that 'git submodule' itself understands. This removes a difference between the CLI API of "git submodule" and "git submodule--helper", making it easier to make the latter an alias for the former. See 48308681b07 (git submodule update: have a dedicated helper for cloning, 2016-02-29) for the initial addition of --update. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 1c1dc32092..7fc7119fb2 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -40,7 +40,9 @@ require_init=
files=
remote=
nofetch=
-update=
+rebase=
+merge=
+checkout=
custom_name=
depth=
progress=
@@ -260,7 +262,7 @@ cmd_update()
force=$1
;;
-r|--rebase)
- update="rebase"
+ rebase=1
;;
--reference)
case "$2" in '') usage ;; esac
@@ -274,13 +276,13 @@ cmd_update()
dissociate=1
;;
-m|--merge)
- update="merge"
+ merge=1
;;
--recursive)
recursive=1
;;
--checkout)
- update="checkout"
+ checkout=1
;;
--recommend-shallow)
recommend_shallow="--recommend-shallow"
@@ -341,7 +343,9 @@ cmd_update()
${init:+--init} \
${nofetch:+--no-fetch} \
${wt_prefix:+--prefix "$wt_prefix"} \
- ${update:+--update "$update"} \
+ ${rebase:+--rebase} \
+ ${merge:+--merge} \
+ ${checkout:+--checkout} \
${reference:+"$reference"} \
${dissociate:+"--dissociate"} \
${depth:+"$depth"} \