diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-04 13:00:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-04 13:00:35 -0700 |
commit | 8ce0ab4ec842ce08b4267d1bd62eff2f0fdba592 (patch) | |
tree | 96d1156763c9a93011b97c09b679512d623974b0 | |
parent | 5ccb7e2ef33612075fe6eedbf08c020b3ea1e7b9 (diff) | |
parent | 862ae6cd67ff79c0ec6629e78ea4cb24a1ae3db1 (diff) | |
download | git-8ce0ab4ec842ce08b4267d1bd62eff2f0fdba592.tar.gz |
Merge branch 'rs/submodule-summary-limit' into maint
"submodule summary --summary-limit" option did not support
"--option=value" form.
* rs/submodule-summary-limit:
submodule summary: support --summary-limit=<n>
-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 |