summaryrefslogtreecommitdiff
path: root/buildstream/plugins/sources/git.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-09-01 19:58:25 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-09-01 20:21:48 -0400
commit3d1a61d22b9a8097152784b7231c727770784d89 (patch)
treebe7bcfe43918160815275ad39fb8162d1364a592 /buildstream/plugins/sources/git.py
parentc9759ebbcbe548a514787e09a1e2b7dc5361ae15 (diff)
downloadbuildstream-3d1a61d22b9a8097152784b7231c727770784d89.tar.gz
git.py source plugin: Consider submodules in cache key
NOTE: This changes cache keys for existing sources which have submodules configured. Presence of submodules in the source configuration changes the configuration significantly, this should be considered in cache keys.
Diffstat (limited to 'buildstream/plugins/sources/git.py')
-rw-r--r--buildstream/plugins/sources/git.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 8eb5eda78..e1cac9716 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -237,7 +237,14 @@ class GitSource(Source):
# Here we want to encode the local name of the repository and
# the ref, if the user changes the alias to fetch the same sources
# from another location, it should not effect the cache key.
- return [self.original_url, self.mirror.ref]
+ key = [self.original_url, self.mirror.ref]
+
+ # We want the cache key to change if the source was
+ # configured differently, and submodules count.
+ if self.submodule_overrides:
+ key.append(self.submodule_overrides)
+
+ return key
def get_consistency(self):
if self.have_all_refs():