diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-08-08 18:24:18 +0100 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-08-08 18:24:18 +0100 |
commit | cc1202d5adf4d40c7434d1b4ce932d4093fd82ad (patch) | |
tree | d5c8db0586bd70d23e2fb06614ead491973df2d0 | |
parent | 6ef51eb61daf2447f4039ecc35b5f86a67028a47 (diff) | |
download | buildstream-537-mirror-fallback-does-not-work-for-git.tar.gz |
Attempt to fix further problems with the git source537-mirror-fallback-does-not-work-for-git
-rw-r--r-- | buildstream/plugins/sources/git.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py index 802d4ff8f..ce7985f3b 100644 --- a/buildstream/plugins/sources/git.py +++ b/buildstream/plugins/sources/git.py @@ -102,6 +102,7 @@ class GitMirror(SourceFetcher): self._path = path self._ref = ref + self._alias_override = None # Ensures that the mirror exists def ensure(self, alias_override=None): @@ -163,6 +164,7 @@ class GitMirror(SourceFetcher): cwd=self.mirror) def fetch(self, alias_override=None): + self._alias_override = alias_override self.ensure(alias_override) if not self.has_ref(): self._fetch(alias_override) @@ -294,12 +296,13 @@ class GitMirror(SourceFetcher): return None def get_submodule_path(self, url): + real_url = self.source.translate_url(url) for parser, section in self._read_gitmodules(): parsed_url = parser.get(section, 'url') - if parsed_url == url: + if parsed_url == real_url: return parser.get(section, 'path') - raise SourceError("{}: No submodule found with url '{}'".format(self.source, url)) + raise SourceError("{}: No submodule found with url '{}'".format(self.source, real_url)) @property def path(self): |