Skip to content

Commit 8ce0ab4

Browse files
committed
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>
2 parents 5ccb7e2 + 862ae6c commit 8ce0ab4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

git-submodule.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ module_clone()
266266
(clear_local_git_env; cd "$sm_path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
267267
}
268268

269+
isnumber()
270+
{
271+
n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
272+
}
273+
269274
#
270275
# Add a new submodule to the working tree, .gitmodules and the index
271276
#
@@ -814,14 +819,14 @@ cmd_summary() {
814819
for_status="$1"
815820
;;
816821
-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
823824
shift
824825
;;
826+
--summary-limit=*)
827+
summary_limit="${1#--summary-limit=}"
828+
isnumber "$summary_limit" || usage
829+
;;
825830
--)
826831
shift
827832
break

0 commit comments

Comments
 (0)