浏览代码

Repo.init: Fix mkdir argument; default to False for the moment as that's consistent with existing behaviour.

Jelmer Vernooij 14 年之前
父节点
当前提交
a02eb38748
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      dulwich/repo.py

+ 4 - 2
dulwich/repo.py

@@ -1187,14 +1187,16 @@ class Repo(BaseRepo):
         return "<Repo at %r>" % self.path
 
     @classmethod
-    def init(cls, path, mkdir=True):
+    def init(cls, path, mkdir=False):
+        if mkdir:
+            os.mkdir(path)
         controldir = os.path.join(path, ".git")
         os.mkdir(controldir)
         cls.init_bare(controldir)
         return cls(path)
 
     @classmethod
-    def init_bare(cls, path, mkdir=True):
+    def init_bare(cls, path):
         for d in BASE_DIRECTORIES:
             os.mkdir(os.path.join(path, *d))
         DiskObjectStore.init(os.path.join(path, OBJECTDIR))