summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:20 (GMT)
commit21b2e60400754732bd509f393b3368f9fa530602 (patch)
tree1fb76a8061bd2f5a2000c8616568ee2efa91b6ce /git-submodule.sh
parentfd87e705b377402f011f3dce4294135b8fba91f8 (diff)
parentf6a527997743b79d6986a16313a7488cfc53d123 (diff)
downloadgit-21b2e60400754732bd509f393b3368f9fa530602.zip
git-21b2e60400754732bd509f393b3368f9fa530602.tar.gz
git-21b2e60400754732bd509f393b3368f9fa530602.tar.bz2
Merge branch 'sb/submodule-deinit-all'
Correct faulty recommendation to use "git submodule deinit ." when de-initialising all submodules, which would result in a strange error message in a pathological corner case. * sb/submodule-deinit-all: submodule deinit: require '--all' instead of '.' for all submodules
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 14d02cc..72fa391 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -8,7 +8,7 @@ dashless=$(basename "$0" | sed -e 's/-/ /')
USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: $dashless [--quiet] init [--] [<path>...]
- or: $dashless [--quiet] deinit [-f|--force] [--] <path>...
+ or: $dashless [--quiet] deinit [-f|--force] (--all| [--] <path>...)
or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: $dashless [--quiet] foreach [--recursive] <command>
@@ -415,6 +415,7 @@ cmd_init()
cmd_deinit()
{
# parse $args after "submodule ... deinit".
+ deinit_all=
while test $# -ne 0
do
case "$1" in
@@ -424,6 +425,9 @@ cmd_deinit()
-q|--quiet)
GIT_QUIET=1
;;
+ --all)
+ deinit_all=t
+ ;;
--)
shift
break
@@ -438,9 +442,14 @@ cmd_deinit()
shift
done
- if test $# = 0
+ if test -n "$deinit_all" && test "$#" -ne 0
+ then
+ echo >&2 "$(eval_gettext "pathspec and --all are incompatible")"
+ usage
+ fi
+ if test $# = 0 && test -z "$deinit_all"
then
- die "$(eval_gettext "Use '.' if you really want to deinitialize all submodules")"
+ die "$(eval_gettext "Use '--all' if you really want to deinitialize all submodules")"
fi
git submodule--helper list --prefix "$wt_prefix" "$@" |