From c369fc46d079447d216f7ef309ff60abe493cdb6 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 8 Aug 2024 09:35:47 +0200 Subject: builtin/submodule: allow "add" to use different ref storage format Same as with "clone", users may want to add a submodule to a repository with a non-default ref storage format. Wire up a new `--ref-format=` option that works the same as for `git submodule clone`. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- git-submodule.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index 448d58b18b..03c5a220a2 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -94,6 +94,14 @@ cmd_add() --reference=*) reference_path="${1#--reference=}" ;; + --ref-format) + case "$2" in '') usage ;; esac + ref_format="--ref-format=$2" + shift + ;; + --ref-format=*) + ref_format="$1" + ;; --dissociate) dissociate=1 ;; @@ -135,6 +143,7 @@ cmd_add() ${progress:+"--progress"} \ ${branch:+--branch "$branch"} \ ${reference_path:+--reference "$reference_path"} \ + ${ref_format:+"$ref_format"} \ ${dissociate:+--dissociate} \ ${custom_name:+--name "$custom_name"} \ ${depth:+"$depth"} \ -- cgit v1.3