Skip to content

Commit

Permalink
submodule summary: support --summary-limit=<n>
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Apr 1, 2013
1 parent 803a777 commit 862ae6c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 862ae6c

Please sign in to comment.