Set core.bare to true on mirror repositories

When creating a mirror repository we will always be using a bare
repository.  Setting $GIT_DIR/config to have core.bare = true is
reasonable and helps Git to recognize the environment it is in.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce 2009-03-03 17:53:18 -08:00
parent 44469464d2
commit 2816d4f387

View File

@ -851,6 +851,10 @@ class Project(object):
if not os.path.exists(self.gitdir):
os.makedirs(self.gitdir)
self.bare_git.init()
if self.manifest.IsMirror:
self.config.SetString('core.bare', 'true')
else:
self.config.SetString('core.bare', None)
hooks = self._gitdir_path('hooks')