]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-submodule.sh: setup uninitialized variables
authorLi Xuejiang <xuejiang@alibaba-inc.com>
Thu, 2 Apr 2020 08:42:51 +0000 (16:42 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Apr 2020 18:19:33 +0000 (11:19 -0700)
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 pathspec '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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh

index aaa1809d243c6671a9c6fc959d96bd366a65efec..aba3e109a4aef6e2ada47b4a51639522104f07f3 100755 (executable)
@@ -47,6 +47,8 @@ custom_name=
 depth=
 progress=
 dissociate=
+jobs=
+recommend_shallow=
 
 die_if_unmatched ()
 {