Browse Source

compat tests: honour PATH environment variable in run_git()

Copy PATH into the environment used by subprocess.Popen().

This makes it possible to use Git binaries installed in non-standard
locations, such as ~/bin. And it allows running compat tests on OpenBSD,
where "git" sits in /usr/local/bin by default, and where /usr/local/bin
is not in the default PATH of the shell.
Stefan Sperling 2 years ago
parent
commit
b0857a2656
1 changed files with 1 additions and 0 deletions
  1. 1 0
      dulwich/tests/compat/utils.py

+ 1 - 0
dulwich/tests/compat/utils.py

@@ -139,6 +139,7 @@ def run_git(
 
     env = popen_kwargs.pop("env", {})
     env["LC_ALL"] = env["LANG"] = "C"
+    env["PATH"] = os.getenv("PATH")
 
     args = [git_path] + args
     popen_kwargs["stdin"] = subprocess.PIPE