mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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:
parent
44469464d2
commit
2816d4f387
@ -851,6 +851,10 @@ class Project(object):
|
|||||||
if not os.path.exists(self.gitdir):
|
if not os.path.exists(self.gitdir):
|
||||||
os.makedirs(self.gitdir)
|
os.makedirs(self.gitdir)
|
||||||
self.bare_git.init()
|
self.bare_git.init()
|
||||||
|
|
||||||
|
if self.manifest.IsMirror:
|
||||||
|
self.config.SetString('core.bare', 'true')
|
||||||
|
else:
|
||||||
self.config.SetString('core.bare', None)
|
self.config.SetString('core.bare', None)
|
||||||
|
|
||||||
hooks = self._gitdir_path('hooks')
|
hooks = self._gitdir_path('hooks')
|
||||||
|
Loading…
Reference in New Issue
Block a user