git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jiang Xin <worldhello.net@gmail.com>
Date
Apr 2, 2020, 08:42 UTC
Message-ID
<20200402084251.85840-1-zhiyou.jx@alibaba-inc.com>
From: xuejiang <xuejiang@alibaba-inc.com>

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@gmail.com>
Signed-off-by: Li Xuejiang <xuejiang@alibaba-inc.com>
---
 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
Next: Eric Sunshine
Message 1 of 3 in “git-submodule.sh: setup uninitialized variables”
  1. git-submodule.sh: setup uninitialized variablesJiang Xin, Apr 2, 2020
  2. Eric SunshineApr 2, 2020
  3. Jiang XinApr 3, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.