diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2013-04-01 15:06:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-01 07:37:34 -0700 |
commit | 862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1 (patch) | |
tree | 10035cf03c757b79832a97a8168b38d0416b8b16 | |
parent | cat-file: Fix an gcc -Wuninitialized warning (diff) | |
download | tgif-862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1.tar.xz |
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>
-rwxr-xr-x | git-submodule.sh | 17 |
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 |