Weird problem with git-submodule.sh
- From
Marc Branchaud <marcnarc@xiplink.com>
- Date
- Dec 7, 2012, 17:44 UTC
- Message-ID
- <50C22B15.1030607@xiplink.com>
Hi all,
This is with git 1.8.0.1 on all the machines involved.
One of our build machines is having trouble with "git submodule":
$ git submodule init external/openssl No submodule mapping found in .gitmodules for path ''
(.gitmodules and other aspects of the repo are fine -- the submodules work perfectly on other machines.)
The problem seems to be in cmd_init() with the construct
module_list "$@" | while read mode sha1 stage sm_path do ...
Explicitly setting IFS before the call to module_list makes it work:
IFS=" " module_list "$@" | while read mode sha1 stage sm_path do ...
If IFS is unset, the "while read" loop ends up with everything in the $mode variable, and the other 3 variables are empty.
If I isolate module_list() and a simple "while read" loop into a standalone script, like this:
module_list()
{
...
}module_list "$@" | while read mode sha1 stage sm_path do echo - $mode - $sha1 - $stage - $sm_path - done
It works -- each individual variable is set properly.
It seems that the problem only occurs inside git-submodule.sh.
Any ideas?
M.