summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorLibravatar Casey Fitzpatrick <kcghost@gmail.com>2018-05-03 06:53:46 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-22 12:22:42 +0900
commita0ef29341accafa51345e90225d87f6a0d297b7b (patch)
tree5c890ac6cf58f59f9946b4e75c288b2a561d1e51 /git-submodule.sh
parentsubmodule: add --progress option to add command (diff)
downloadtgif-a0ef29341accafa51345e90225d87f6a0d297b7b.tar.xz
submodule: add --dissociate option to add/update commands
Add --dissociate option to add and update commands, both clone helper commands that already have the --reference option --dissociate pairs with. Signed-off-by: Casey Fitzpatrick <kcghost@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 39c241a1d8..1fddc098f5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -42,6 +42,7 @@ prefix=
custom_name=
depth=
progress=
+dissociate=
die_if_unmatched ()
{
@@ -128,6 +129,9 @@ cmd_add()
--reference=*)
reference_path="${1#--reference=}"
;;
+ --dissociate)
+ dissociate=1
+ ;;
--name)
case "$2" in '') usage ;; esac
custom_name=$2
@@ -258,7 +262,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} ${progress:+"--progress"} --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" &&
@@ -493,6 +497,9 @@ cmd_update()
--reference=*)
reference="$1"
;;
+ --dissociate)
+ dissociate=1
+ ;;
-m|--merge)
update="merge"
;;
@@ -550,6 +557,7 @@ cmd_update()
${prefix:+--recursive-prefix "$prefix"} \
${update:+--update "$update"} \
${reference:+"$reference"} \
+ ${dissociate:+"--dissociate"} \
${depth:+--depth "$depth"} \
$recommend_shallow \
$jobs \