|
@@ -145,13 +145,13 @@ class GitClient(object):
|
|
|
|
|
|
class TCPGitClient(GitClient):
|
|
|
|
|
|
- def __init__(self, host, port=TCP_GIT_PORT):
|
|
|
+ def __init__(self, host, port=TCP_GIT_PORT, capabilities=None):
|
|
|
self._socket = socket.socket(type=socket.SOCK_STREAM)
|
|
|
self._socket.connect((host, port))
|
|
|
self.rfile = self._socket.makefile('rb', -1)
|
|
|
self.wfile = self._socket.makefile('wb', 0)
|
|
|
self.host = host
|
|
|
- super(TCPGitClient, self).__init__(self._socket.fileno(), self.rfile.read, self.wfile.write)
|
|
|
+ super(TCPGitClient, self).__init__(self._socket.fileno(), self.rfile.read, self.wfile.write, capabilities=capabilities)
|
|
|
|
|
|
def send_pack(self, path):
|
|
|
self.proto.send_cmd("git-receive-pack", path, "host=%s" % self.host)
|
|
@@ -164,8 +164,9 @@ class TCPGitClient(GitClient):
|
|
|
|
|
|
class SubprocessGitClient(GitClient):
|
|
|
|
|
|
- def __init__(self):
|
|
|
+ def __init__(self, capabilities=None):
|
|
|
self.proc = None
|
|
|
+ self.capabilities = capabilities
|
|
|
|
|
|
def _connect(self, service, *args):
|
|
|
argv = [service] + list(args)
|
|
@@ -177,7 +178,7 @@ class SubprocessGitClient(GitClient):
|
|
|
def write_fn(data):
|
|
|
self.proc.stdin.write(data)
|
|
|
self.proc.stdin.flush()
|
|
|
- return GitClient(self.proc.stdout.fileno(), read_fn, write_fn)
|
|
|
+ return GitClient(self.proc.stdout.fileno(), read_fn, write_fn, capabilities=self.capabilities)
|
|
|
|
|
|
def send_pack(self, path):
|
|
|
client = self._connect("git-receive-pack", path)
|