[PATCH] git-submodule.sh: setup uninitialized variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: xuejiang <xuejiang@xxxxxxxxxxxxxxx>

We have an environment variable `jobs=16` defined in our CI system, and
this environment makes our build job failed with the following message:

    error: pathspec '16' did not match any file(s) known to git

The pathspect '16' for Git command is from the environment variable
"jobs".

This is because "git-submodule" command is implemented in shell script,
and environment variables may change its behavior.  Set values for
uninitialized variables, such as "jobs" and "recommend_shallow" will
fix this issue.

Helped-by: Jiang Xin <worldhello.net@xxxxxxxxx>
Signed-off-by: Li Xuejiang <xuejiang@xxxxxxxxxxxxxxx>
---
 git-submodule.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/git-submodule.sh b/git-submodule.sh
index 1cb2c0a31b..d69d24a857 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -43,6 +43,8 @@ custom_name=
 depth=
 progress=
 dissociate=
+jobs=
+recommend_shallow=
 
 die_if_unmatched ()
 {
-- 
2.20.1.7.g153144c




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux