浏览代码

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 年之前
父节点
当前提交
b0857a2656
共有 1 个文件被更改,包括 1 次插入0 次删除
  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