From 862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 1 Apr 2013 15:06:27 +0200 Subject: submodule summary: support --summary-limit= In addition to "--summary-limit " support the form "--summary-limit=", for consistency with other parameters and commands. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- git-submodule.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index ab29bfeb7..b3108b8ea 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 -- cgit v1.2.1