diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-06-28 12:05:31 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-06-28 22:13:17 +0200 |
commit | 8f12108c2951cdfa181d6be66b6def28cd007bdd (patch) | |
tree | f82b6a8e159f12d41e7878ab4acaf127a4734d8e /git-submodule.sh | |
parent | submodule--helper: report "submodule" as our name in some "-h" output (diff) | |
download | git-8f12108c2951cdfa181d6be66b6def28cd007bdd.tar.xz git-8f12108c2951cdfa181d6be66b6def28cd007bdd.zip |
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-x | git-submodule.sh | 14 |
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"} \ |