فهرست منبع

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>
Shawn O. Pearce 17 سال پیش
والد
کامیت
2816d4f387
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      project.py

+ 5 - 1
project.py

@@ -851,7 +851,11 @@ class Project(object):
     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: