summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-03 09:34:46 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-03 09:34:46 -0700
commite3b1173fb1233197fcaabbce84b9a0f33d24d09b (patch)
tree0492477f7134197f72e8660c17f0fd640b825915 /git-submodule.sh
parentd3ea5826e4d27dea7bebf3b3029d183ddf31567a (diff)
parent862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1 (diff)
downloadgit-e3b1173fb1233197fcaabbce84b9a0f33d24d09b.tar.gz
Merge branch 'rs/submodule-summary-limit'
"submodule summary --summary-limit" option did not support "--option=value" form. * rs/submodule-summary-limit: submodule summary: support --summary-limit=<n>
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 204bc78a9f..275c664ff5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -267,6 +267,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
#
@@ -889,14 +894,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