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>
diff --git a/git-submodule.sh b/git-submodule.sh
index 1c1dc32..7fc7119 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -40,7 +40,9 @@
files=
remote=
nofetch=
-update=
+rebase=
+merge=
+checkout=
custom_name=
depth=
progress=
@@ -260,7 +262,7 @@
force=$1
;;
-r|--rebase)
- update="rebase"
+ rebase=1
;;
--reference)
case "$2" in '') usage ;; esac
@@ -274,13 +276,13 @@
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 @@
${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"} \