summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <joshsmith@codethink.co.uk>2018-08-09 11:24:01 +0100
committerJosh Smith <qinusty@gmail.com>2018-08-15 12:15:58 +0100
commit4669309e8417f15704d8132f1aa660a8d38887db (patch)
tree00848326b4478a4f10c086b1784cf8da135874e2
parentf3d58233793cf0249cbac51f72d5c459eb256d44 (diff)
downloadbuildstream-4669309e8417f15704d8132f1aa660a8d38887db.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 cf2f649db..855e766d2 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
@@ -84,6 +90,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
@@ -283,7 +292,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