瀏覽代碼

Always require a Git repository object to be passed into
dulwich.server.GitBackend.

Jelmer Vernooij 15 年之前
父節點
當前提交
a36938b203
共有 1 個文件被更改,包括 2 次插入7 次删除
  1. 2 7
      dulwich/server.py

+ 2 - 7
dulwich/server.py

@@ -28,7 +28,6 @@ Documentation/technical directory in the cgit distribution, and in particular:
 
 
 import collections
 import collections
 import SocketServer
 import SocketServer
-import tempfile
 
 
 from dulwich.errors import (
 from dulwich.errors import (
     ApplyDeltaError,
     ApplyDeltaError,
@@ -50,14 +49,12 @@ from dulwich.protocol import (
     MULTI_ACK_DETAILED,
     MULTI_ACK_DETAILED,
     ack_type,
     ack_type,
     )
     )
-from dulwich.repo import (
-    Repo,
-    )
 from dulwich.pack import (
 from dulwich.pack import (
     write_pack_data,
     write_pack_data,
     )
     )
 
 
 class Backend(object):
 class Backend(object):
+    """A backend for the Git smart server implementation."""
 
 
     def get_refs(self):
     def get_refs(self):
         """
         """
@@ -90,9 +87,7 @@ class Backend(object):
 
 
 class GitBackend(Backend):
 class GitBackend(Backend):
 
 
-    def __init__(self, repo=None):
-        if repo is None:
-            repo = Repo(tempfile.mkdtemp())
+    def __init__(self, repo):
         self.repo = repo
         self.repo = repo
         self.refs = self.repo.refs
         self.refs = self.repo.refs
         self.object_store = self.repo.object_store
         self.object_store = self.repo.object_store