Bare-repo related changes: have no index and bare=true in config.
authorDirk <dirk@opani.com>
Sat, 21 Aug 2010 17:29:22 +0000 (17:29 +0000)
committerDirk <dirk@opani.com>
Sat, 21 Aug 2010 17:29:22 +0000 (17:29 +0000)
dulwich/repo.py

index 54a554684aea08b8d7c4753ff427445cb2ee0cf5..0e08ef02735a627d835e15f913801fda2a282591 100644 (file)
@@ -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