浏览代码

Fix run_git_or_fail to let stderr be overridden.

GitHTTPServer relies on stderr being sent to nowhere, but
run_git_or_fail always sent it to stdout, causing non-side-band clients
to fail.
William Grant 11 年之前
父节点
当前提交
ad99ceee03
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      dulwich/tests/compat/utils.py

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

@@ -134,7 +134,8 @@ def run_git(args, git_path=_DEFAULT_GIT, input=None, capture_stdout=False,
 
 def run_git_or_fail(args, git_path=_DEFAULT_GIT, input=None, **popen_kwargs):
     """Run a git command, capture stdout/stderr, and fail if git fails."""
-    popen_kwargs['stderr'] = subprocess.STDOUT
+    if 'stderr' not in popen_kwargs:
+        popen_kwargs['stderr'] = subprocess.STDOUT
     returncode, stdout = run_git(args, git_path=git_path, input=input,
                                  capture_stdout=True, **popen_kwargs)
     if returncode != 0: