소스 검색

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 년 전
부모
커밋
aea6fbec53
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: