Use reference also for manifest git
When running 'repo init --reference=<mirror>', 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 <cdesai@cyanogenmod.org>
This commit is contained in:
parent
793f90cdc0
commit
2b30e3aaba
2 changed files with 27 additions and 5 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue