threads / patch / 14571

patchgit-submodule: move ill placed shift.

Subject: [PATCH] git-submodule: move ill placed shift.

## tl;dr

One message between Jul 21, 2008 and Jul 21, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pierre Habouzit· Jul 21, 2008, 18:15 UTC · lore

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).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-submodule.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-submodule.sh +1 −1
diff --git a/git-submodule.sh b/git-submodule.sh
index 9228f56..b40f876 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -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 ' |
-- 
1.6.0.rc0.138.g5af7f.dirty

← back to recent threads