Quellcode durchsuchen

Add write_error argument to GitClient.archive().

Jelmer Vernooij vor 11 Jahren
Ursprung
Commit
f5c0a12252
2 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
  1. 4 2
      dulwich/client.py
  2. 2 1
      dulwich/porcelain.py

+ 4 - 2
dulwich/client.py

@@ -536,7 +536,8 @@ class TraditionalGitClient(GitClient):
                 proto, negotiated_capabilities, graph_walker, pack_data, progress)
             return refs
 
-    def archive(self, path, committish, write_data, progress=None):
+    def archive(self, path, committish, write_data, progress=None,
+                write_error=None):
         proto, can_read = self._connect(b'upload-archive', path)
         with proto:
             proto.write_pkt_line("argument %s" % committish)
@@ -553,7 +554,8 @@ class TraditionalGitClient(GitClient):
             ret = proto.read_pkt_line()
             if ret is not None:
                 raise AssertionError("expected pkt tail")
-            self._read_side_band64k_data(proto, {1: write_data, 2: progress})
+            self._read_side_band64k_data(proto, {
+                1: write_data, 2: progress, 3: write_error})
 
 
 class TCPGitClient(TraditionalGitClient):

+ 2 - 1
dulwich/porcelain.py

@@ -90,7 +90,8 @@ def archive(location, committish=None, outstream=sys.stdout,
         committish = "HEAD"
     # TODO(jelmer): This invokes C git; this introduces a dependency.
     # Instead, dulwich should have its own archiver implementation.
-    client.archive(path, committish, outstream.write, errstream.write)
+    client.archive(path, committish, outstream.write, errstream.write,
+                   errstream.write)
 
 
 def update_server_info(repo="."):