From 2b30e3aabafa43c224cb6d57dc232d78b28a4901 Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Fri, 5 Oct 2012 12:37:58 +0200 Subject: Use reference also for manifest git When running 'repo init --reference=', the mirror will be used for all projects except the manifest project. This is because the _InitGitDir function uses the 'repo.reference' git config value specified in the manifest git, which has no effect when creating the manifest git as that value will be set after the git has been successfully cloned. Information about where the manifest git is located on the server is only known when performing the 'repo init', so that information has to be provided when cloning the git in order for it to set up a proper mapping. Change-Id: I47a2c8b3267a4065965058718ce1def4ecb34d5a Signed-off-by: Chirayu Desai --- project.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 516d3b6c..effe75c4 100644 --- a/project.py +++ b/project.py @@ -1854,16 +1854,17 @@ class Project(object): if GitCommand(self, cmd).Wait() != 0: raise GitError('%s merge %s ' % (self.name, head)) - def _InitGitDir(self): + def _InitGitDir(self, mirror_git=None): if not os.path.exists(self.gitdir): os.makedirs(self.gitdir) self.bare_git.init() mp = self.manifest.manifestProject - ref_dir = mp.config.GetString('repo.reference') + ref_dir = mp.config.GetString('repo.reference') or '' - if ref_dir: - mirror_git = os.path.join(ref_dir, self.name + '.git') + if ref_dir or mirror_git: + if not mirror_git: + mirror_git = os.path.join(ref_dir, self.name + '.git') repo_git = os.path.join(ref_dir, '.repo', 'projects', self.relpath + '.git') -- cgit v1.2.3-54-g00ecf