threads / patch / 23602

patchgit-submodule.sh: properly initialize shell variables

Subject: [PATCH] git-submodule.sh: properly initialize shell variables

## tl;dr

One message between Apr 26, 2010 and Apr 26, 2010. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Gerrit Pape· Apr 26, 2010, 09:50 UTC · lore

git-submodule inherits variables from the environment it is started in, expects the internal variables init= and recursive= to have an empty value, but doesn't initialize them appropriately. Thanks to the selftests, this can be reproduced through

 init=1 make test
 recursive=1 make test

With this commit the variables are initialized, and the selftests succeed even if these variables have some values in the environment.

The bug was discovered through the Debian autobuilders
 http://bugs.debian.org/569594
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 git-submodule.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to git-submodule.sh +2 −0
diff --git a/git-submodule.sh b/git-submodule.sh
index 2dd372a..3319b83 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -21,6 +21,8 @@ command=
 branch=
 reference=
 cached=
+recursive=
+init=
 files=
 nofetch=
 update=
-- 
1.7.0.3

← back to recent threads