Sync correctly when subproject url is a relative url to its parent url

Issue: when subproject url is a relative in .gitmodules
repo tool cannot handle this and cause:
"fatal: '***' does not appear to be a git repository
 fatal: Could not read from remote repository."
issue.

Signed-off-by: Shouheng Zhang <shouheng.zhang@intel.com>
Change-Id: I2a24c291ea0074ba13a740b32a11c0c25975e72b
This commit is contained in:
Shouheng Zhang 2017-12-08 09:54:58 +08:00 committed by Shouheng Zhang
parent 1dc36600ef
commit 02c0ee6ae6

View File

@ -1880,6 +1880,8 @@ class Project(object):
result.extend(project.GetDerivedSubprojects())
continue
if url.startswith('..'):
url = urllib.parse.urljoin("%s/" % self.remote.url, url)
remote = RemoteSpec(self.remote.name,
url=url,
pushUrl=self.remote.pushUrl,