From caa9c3cabe9c2719a340425db5c0968fd3588fc9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 3 Mar 2010 14:19:09 -0800 Subject: 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 --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 5869c00f2d..383dc45119 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 -- cgit v1.2.3