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>

René Scharfe committed Apr 1, 2013 at 15:06 UTC 862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1
1 file changed +11 -6
git-submodule.sh
+11 -6
@@ -266,6 +266,11 @@ module_clone()
266 (clear_local_git_env; cd "$sm_path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
267 }
268
269 +isnumber()
270 +{
271 + n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
272 +}
273 +
274 #
275 # Add a new submodule to the working tree, .gitmodules and the index
276 #
@@ -814,14 +819,14 @@ cmd_summary() {
819 for_status="$1"
820 ;;
821 -n|--summary-limit)
817 - if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2"
818 - then
819 - :
820 - else
821 - usage
822 - fi
822 + summary_limit="$2"
823 + isnumber "$summary_limit" || usage
824 shift
825 ;;
826 + --summary-limit=*)
827 + summary_limit="${1#--summary-limit=}"
828 + isnumber "$summary_limit" || usage
829 + ;;
830 --)
831 shift
832 break