summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2013-04-01 15:06:27 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-01 07:37:34 -0700
commit862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1 (patch)
tree10035cf03c757b79832a97a8168b38d0416b8b16 /git-submodule.sh
parent803a777942b0b1c91890c2f97d4f10972cf2881e (diff)
downloadgit-862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1.tar.gz
submodule summary: support --summary-limit=<n>
In addition to "--summary-limit <n>" support the form "--summary-limit=<n>", for consistency with other parameters and commands. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index ab29bfeb73..b3108b8ea9 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -266,6 +266,11 @@ module_clone()
(clear_local_git_env; cd "$sm_path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
}
+isnumber()
+{
+ n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
+}
+
#
# Add a new submodule to the working tree, .gitmodules and the index
#
@@ -814,14 +819,14 @@ cmd_summary() {
for_status="$1"
;;
-n|--summary-limit)
- if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2"
- then
- :
- else
- usage
- fi
+ summary_limit="$2"
+ isnumber "$summary_limit" || usage
shift
;;
+ --summary-limit=*)
+ summary_limit="${1#--summary-limit=}"
+ isnumber "$summary_limit" || usage
+ ;;
--)
shift
break