Skip to content

Commit caa9c3c

Browse files
peffgitster
authored andcommitted
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 <[email protected]>
1 parent 3deea89 commit caa9c3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ cmd_summary() {
556556
if rev=$(git rev-parse -q --verify --default HEAD ${1+"$1"})
557557
then
558558
head=$rev
559-
shift
559+
test $# = 0 || shift
560560
elif test -z "$1" -o "$1" = "HEAD"
561561
then
562562
return

0 commit comments

Comments
 (0)