Merge branch 'cf/submodule-progress-dissociate'
"git submodule update" and "git submodule add" supported the "--reference" option to borrow objects from a neighbouring local repository like "git clone" does, but lacked the more recent invention "--dissociate". Also "git submodule add" has been taught to take the "--progress" option. * cf/submodule-progress-dissociate: submodule: add --dissociate option to add/update commands submodule: add --progress option to add command submodule: clean up substitutions in script
This commit is contained in:
@ -42,6 +42,7 @@ prefix=
|
||||
custom_name=
|
||||
depth=
|
||||
progress=
|
||||
dissociate=
|
||||
|
||||
die_if_unmatched ()
|
||||
{
|
||||
@ -117,6 +118,9 @@ cmd_add()
|
||||
-q|--quiet)
|
||||
GIT_QUIET=1
|
||||
;;
|
||||
--progress)
|
||||
progress=1
|
||||
;;
|
||||
--reference)
|
||||
case "$2" in '') usage ;; esac
|
||||
reference_path=$2
|
||||
@ -125,6 +129,9 @@ cmd_add()
|
||||
--reference=*)
|
||||
reference_path="${1#--reference=}"
|
||||
;;
|
||||
--dissociate)
|
||||
dissociate=1
|
||||
;;
|
||||
--name)
|
||||
case "$2" in '') usage ;; esac
|
||||
custom_name=$2
|
||||
@ -260,7 +267,7 @@ or you are unsure what this means choose another name with the '--name' option."
|
||||
eval_gettextln "Reactivating local git directory for submodule '\$sm_name'."
|
||||
fi
|
||||
fi
|
||||
git submodule--helper clone ${GIT_QUIET:+--quiet} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${depth:+"$depth"} || exit
|
||||
git submodule--helper clone ${GIT_QUIET:+--quiet} ${progress:+"--progress"} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${dissociate:+"--dissociate"} ${depth:+"$depth"} || exit
|
||||
(
|
||||
sanitize_submodule_env
|
||||
cd "$sm_path" &&
|
||||
@ -470,7 +477,7 @@ cmd_update()
|
||||
GIT_QUIET=1
|
||||
;;
|
||||
--progress)
|
||||
progress="--progress"
|
||||
progress=1
|
||||
;;
|
||||
-i|--init)
|
||||
init=1
|
||||
@ -495,6 +502,9 @@ cmd_update()
|
||||
--reference=*)
|
||||
reference="$1"
|
||||
;;
|
||||
--dissociate)
|
||||
dissociate=1
|
||||
;;
|
||||
-m|--merge)
|
||||
update="merge"
|
||||
;;
|
||||
@ -547,14 +557,15 @@ cmd_update()
|
||||
|
||||
{
|
||||
git submodule--helper update-clone ${GIT_QUIET:+--quiet} \
|
||||
${progress:+"$progress"} \
|
||||
${progress:+"--progress"} \
|
||||
${wt_prefix:+--prefix "$wt_prefix"} \
|
||||
${prefix:+--recursive-prefix "$prefix"} \
|
||||
${update:+--update "$update"} \
|
||||
${reference:+"$reference"} \
|
||||
${dissociate:+"--dissociate"} \
|
||||
${depth:+--depth "$depth"} \
|
||||
${recommend_shallow:+"$recommend_shallow"} \
|
||||
${jobs:+$jobs} \
|
||||
$recommend_shallow \
|
||||
$jobs \
|
||||
"$@" || echo "#unmatched" $?
|
||||
} | {
|
||||
err=
|
||||
|
||||
Reference in New Issue
Block a user