You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:34:48 UTC

[buildstream] 06/06: Attempt to fix further problems with the git source

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch 537-mirror-fallback-does-not-work-for-git
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit cc1202d5adf4d40c7434d1b4ce932d4093fd82ad
Author: Jonathan Maw <jo...@codethink.co.uk>
AuthorDate: Wed Aug 8 18:24:18 2018 +0100

    Attempt to fix further problems with the git source
---
 buildstream/plugins/sources/git.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 802d4ff..ce7985f 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):