From: Jeff King Date: Wed, 3 Mar 2010 22:19:09 +0000 (-0800) Subject: submodule summary: do not shift a non-existent positional variable X-Git-Tag: v1.7.1-rc0~42^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=caa9c3cabe9c2719a340425db5c0968fd3588fc9;p=git.git submodule summary: do not shift a non-existent positional variable When "git submodule summary" is run without any argument, we default to compare the state of index with the HEAD, but tried to shift out $1 that does not exist (and worse yet, we didn't use it). Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 5869c00f2..383dc4511 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -556,7 +556,7 @@ cmd_summary() { if rev=$(git rev-parse -q --verify --default HEAD ${1+"$1"}) then head=$rev - shift + test $# = 0 || shift elif test -z "$1" -o "$1" = "HEAD" then return