builtin/submodule: allow cloning with different ref storage format
As submodules are proper self-contained repositories, it is perfectly valid for them to have a different ref storage format than their parent repository. There is no obvious way for users to ask for the ref storage format when initializing submodules though. Whether the setup of such mixed-ref-storage-format constellations is all that useful remains to be seen. But there is no good reason to not expose such an option, and we will require it in a subsequent patch. Introduce a new `--ref-format=` option for git-submodule(1) that allows the user to pick the ref storage format. This option will also be used in a subsequent commit, where we start to propagate the same flag from git-clone(1) to cloning submodules with the `--recursive` switch. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d9ab8788e1
commit
5ac781ad62
@ -290,6 +290,14 @@ cmd_update()
|
||||
-r|--rebase)
|
||||
rebase=1
|
||||
;;
|
||||
--ref-format)
|
||||
case "$2" in '') usage ;; esac
|
||||
ref_format="--ref-format=$2"
|
||||
shift
|
||||
;;
|
||||
--ref-format=*)
|
||||
ref_format="$1"
|
||||
;;
|
||||
--reference)
|
||||
case "$2" in '') usage ;; esac
|
||||
reference="--reference=$2"
|
||||
@ -371,6 +379,7 @@ cmd_update()
|
||||
${rebase:+--rebase} \
|
||||
${merge:+--merge} \
|
||||
${checkout:+--checkout} \
|
||||
${ref_format:+"$ref_format"} \
|
||||
${reference:+"$reference"} \
|
||||
${dissociate:+"--dissociate"} \
|
||||
${depth:+"$depth"} \
|
||||
|
Reference in New Issue
Block a user