Browse Source

Merge fix from Chris to hide unpacking objects from git during tests.

Jelmer Vernooij 13 years ago
parent
commit
711969d1c9
3 changed files with 8 additions and 2 deletions
  1. 1 0
      AUTHORS
  2. 6 1
      dulwich/client.py
  3. 1 1
      dulwich/tests/compat/test_client.py

+ 1 - 0
AUTHORS

@@ -2,6 +2,7 @@ Jelmer Vernooij <jelmer@samba.org>
 James Westby <jw+debian@jameswestby.net>
 John Carr <john.carr@unrouted.co.uk>
 Dave Borowitz <dborowitz@google.com>
+Chris Eberle <eberle1080@gmail.com>
 
 Hervé Cauwelier <herve@itaapy.com> wrote the original tutorial.
 

+ 6 - 1
dulwich/client.py

@@ -524,6 +524,10 @@ class SubprocessGitClient(TraditionalGitClient):
 
     def __init__(self, *args, **kwargs):
         self._connection = None
+        self._stderr = None
+        self._stderr = kwargs.get('stderr')
+        if 'stderr' in kwargs:
+            del kwargs['stderr']
         GitClient.__init__(self, *args, **kwargs)
 
     def _connect(self, service, path):
@@ -531,7 +535,8 @@ class SubprocessGitClient(TraditionalGitClient):
         argv = ['git', service, path]
         p = SubprocessWrapper(
             subprocess.Popen(argv, bufsize=0, stdin=subprocess.PIPE,
-                             stdout=subprocess.PIPE))
+                             stdout=subprocess.PIPE,
+                             stderr=self._stderr))
         return Protocol(p.read, p.write,
                         report_activity=self._report_activity), p.can_read
 

+ 1 - 1
dulwich/tests/compat/test_client.py

@@ -272,7 +272,7 @@ class DulwichSubprocessClientTest(CompatTestCase, DulwichClientTestBase):
         CompatTestCase.tearDown(self)
 
     def _client(self):
-        return client.SubprocessGitClient()
+        return client.SubprocessGitClient(stderr=subprocess.PIPE)
 
     def _build_path(self, path):
         return self.gitroot + path