summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <joshsmith@codethink.co.uk>2018-08-09 11:24:01 +0100
committerTristan van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-03 16:50:32 -0400
commit6ab4b30a2bc3afe3a472583a5eebc53089dc78c0 (patch)
tree690f8319c8dd14a86867df39e4070b505e78a9a5
parent9f37828ad0d652e43d13cac7895b0d671808e9cb (diff)
downloadbuildstream-6ab4b30a2bc3afe3a472583a5eebc53089dc78c0.tar.gz
git.py: Add configurable warning for inconsistent-submodule
This follows the implementation of configurable warnings.
-rw-r--r--buildstream/plugins/sources/git.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 9ecef445b..041fed123 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -68,6 +68,12 @@ git - stage files from a git repository
url: upstream:baz.git
checkout: False
+**Configurable Warnings:**
+
+This plugin provides the following configurable warnings:
+
+- 'git:inconsistent-submodule' - A submodule was found to be missing from the underlying git repository.
+
"""
import os
@@ -83,6 +89,9 @@ from buildstream import utils
GIT_MODULES = '.gitmodules'
+# Warnings
+INCONSISTENT_SUBMODULE = "inconsistent-submodules"
+
# Because of handling of submodules, we maintain a GitMirror
# for the primary git source and also for each submodule it
@@ -291,7 +300,7 @@ class GitMirror(SourceFetcher):
"underlying git repository with `git submodule add`."
self.source.warn("{}: Ignoring inconsistent submodule '{}'"
- .format(self.source, submodule), detail=detail)
+ .format(self.source, submodule), detail=detail, warning_token=INCONSISTENT_SUBMODULE)
return None