allow user to override capabilities.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 11 Feb 2009 23:27:22 +0000 (23:27 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 11 Feb 2009 23:27:22 +0000 (23:27 +0000)
dulwich/client.py

index 6ed3c3369def00ae2a7958bf682fc34f556f1d0f..c96b64ce79f28bbc483aef0ed0942e186b1510e2 100644 (file)
@@ -47,17 +47,24 @@ class SimpleFetchGraphWalker(object):
         return None
 
 
+DEFAULT_CAPABILITIES = ["multi_ack", "side-band-64k", "thin-pack", "ofs-delta"]
+
+
 class GitClient(object):
     """Git smart server client.
 
     """
 
-    def __init__(self, fileno, read, write):
+    def __init__(self, fileno, read, write, capabilities=None):
         self.proto = Protocol(read, write)
         self.fileno = fileno
+        if capabilities is None:
+            self.capabilities = DEFAULT_CAPABILITIES
+        else:
+            self.capabilities = capabilities
 
     def capabilities(self):
-        return "multi_ack side-band-64k thin-pack ofs-delta"
+        return " ".join(self.capabilities)
 
     def read_refs(self):
         server_capabilities = None