Executable.add_default_arg: multiple (#40801)
This commit is contained in:
@@ -773,8 +773,7 @@ def git(self):
|
||||
# Disable advice for a quieter fetch
|
||||
# https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.2.txt
|
||||
if self.git_version >= spack.version.Version("1.7.2"):
|
||||
self._git.add_default_arg("-c")
|
||||
self._git.add_default_arg("advice.detachedHead=false")
|
||||
self._git.add_default_arg("-c", "advice.detachedHead=false")
|
||||
|
||||
# If the user asked for insecure fetching, make that work
|
||||
# with git as well.
|
||||
|
@@ -35,9 +35,9 @@ def __init__(self, name):
|
||||
if not self.exe:
|
||||
raise ProcessError("Cannot construct executable for '%s'" % name)
|
||||
|
||||
def add_default_arg(self, arg):
|
||||
"""Add a default argument to the command."""
|
||||
self.exe.append(arg)
|
||||
def add_default_arg(self, *args):
|
||||
"""Add default argument(s) to the command."""
|
||||
self.exe.extend(args)
|
||||
|
||||
def add_default_env(self, key, value):
|
||||
"""Set an environment variable when the command is run.
|
||||
|
@@ -24,7 +24,6 @@ def git(required: bool = False):
|
||||
# If we're running under pytest, add this to ignore the fix for CVE-2022-39253 in
|
||||
# git 2.38.1+. Do this in one place; we need git to do this in all parts of Spack.
|
||||
if git and "pytest" in sys.modules:
|
||||
git.add_default_arg("-c")
|
||||
git.add_default_arg("protocol.file.allow=always")
|
||||
git.add_default_arg("-c", "protocol.file.allow=always")
|
||||
|
||||
return git
|
||||
|
Reference in New Issue
Block a user