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>
diff --git a/project.py b/project.py
index adb7f66..b979252 100644
--- a/project.py
+++ b/project.py
@@ -851,7 +851,11 @@
if not os.path.exists(self.gitdir):
os.makedirs(self.gitdir)
self.bare_git.init()
- self.config.SetString('core.bare', None)
+
+ if self.manifest.IsMirror:
+ self.config.SetString('core.bare', 'true')
+ else:
+ self.config.SetString('core.bare', None)
hooks = self._gitdir_path('hooks')
try: