瀏覽代碼

Merge some bare-repo related fixes from Dirk Neumann.

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

+ 2 - 2
dulwich/repo.py

@@ -770,7 +770,7 @@ class BaseRepo(object):
         self._put_named_file('config', ('[core]\n'
                                         'repositoryformatversion = 0\n'
                                         'filemode = true\n'
-                                        'bare = false\n'
+                                        'bare = ' + str(self.bare).lower() + '\n'
                                         'logallrefupdates = true\n'))
         self._put_named_file(os.path.join('info', 'exclude'), '')
 
@@ -1031,9 +1031,9 @@ class BaseRepo(object):
         :return: New commit SHA1
         """
         import time
-        index = self.open_index()
         c = Commit()
         if tree is None:
+            index = self.open_index()
             c.tree = index.commit(self.object_store)
         else:
             c.tree = tree