Skip to contentSkip to conversation

git-submodule: move ill placed shift.

PATCH New Pierre Habouzit 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-submodule: move ill placed shift.

When running git submodule update -i, the "-i" is shifted before recursing into cmd_init and then again outside of the loop. This causes some /bin/sh to complain about shifting when there are no arguments left (and would discard anything written after -i too).

---
 git-submodule.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-submodule.sh +1 -1
index 9228f56..b40f876 100755
@@ -264,6 +264,7 @@ cmd_update()
 	do
 		case "$1" in
 		-q|--quiet)
+			shift
 			quiet=1
 			;;
 		-i|--init)
@@ -281,7 +282,6 @@ cmd_update()
 			break
 			;;
 		esac
-		shift
 	done
 
 	git ls-files --stage -- "$@" | grep '^160000 ' |
Signature · 1 line
1.6.0.rc0.138.g5af7f.dirty