Skip to content
Snippets Groups Projects
Commit d0baa46c authored by Qinusty's avatar Qinusty
Browse files

git.py: Add configurable warning for inconsistent-submodule

This follows the implementation of configurable warnings.
parent c699371b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -350,6 +359,9 @@ class GitSource(Source):
return Consistency.RESOLVED
return Consistency.INCONSISTENT
def get_warnings(self):
return [INCONSISTENT_SUBMODULE]
def load_ref(self, node):
self.mirror.ref = self.node_get_member(node, str, 'ref', None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment