Browse Source

Fallback to local git-foo if not git:// or git+ssh://. Remove unused stuff from SubprocessGitClient. Lets try a bufsize of 0.

John Carr 16 years ago
parent
commit
5dcd49dc91
2 changed files with 4 additions and 7 deletions
  1. 3 2
      bin/dulwich
  2. 1 5
      dulwich/client.py

+ 3 - 2
bin/dulwich

@@ -21,12 +21,13 @@ import sys
 from getopt import getopt
 
 def get_transport_and_path(uri):
-    from dulwich.client import TCPGitClient, SSHGitClient
+    from dulwich.client import TCPGitClient, SSHGitClient, SubprocessGitClient
     for handler, transport in (("git://", TCPGitClient), ("git+ssh://", SSHGitClient)):
         if uri.startswith(handler):
             host, path = uri[len(handler):].split("/", 1)
             return transport(host), "/"+path
-    return None, None
+    # if its not git or git+ssh, try a local url..
+    return SubprocessGitClient(), uri
 
 def cmd_fetch_pack(args):
 	from dulwich.client import SimpleFetchGraphWalker

+ 1 - 5
dulwich/client.py

@@ -158,13 +158,9 @@ class TCPGitClient(GitClient):
 
 class SubprocessGitClient(GitClient):
 
-    def __init__(self, host, port=None):
-        self.host = host
-        self.port = port
-
     def _connect(self, service, *args):
         argv = [service] + list(args)
-        proc = subprocess.Popen(argv,
+        proc = subprocess.Popen(argv, bufsize=0,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE, env={'GIT_TRACE':'2'})
         def write_fn(date):