Enforce label uniqueness in ProjectConfig and ProjectState
Within a single project, it is an error to specify two different labels that differ only in case. (Multiple [label "Foo"] sections with the same case are automatically collapsed by JGit.) Between projects, it is valid to override a label "Foo" in a parent project with a label "foo" in a child. Change-Id: Ica6b990feefb272d1675c0f006162afbe51335b5
This commit is contained in:
@@ -347,9 +347,10 @@ public class ProjectState {
|
||||
Collections.reverse(projects);
|
||||
for (ProjectState s : projects) {
|
||||
for (LabelType type : s.getConfig().getLabelSections().values()) {
|
||||
LabelType old = types.get(type.getName());
|
||||
String lower = type.getName().toLowerCase();
|
||||
LabelType old = types.get(lower);
|
||||
if (old == null || !old.canOverride()) {
|
||||
types.put(type.getName(), type);
|
||||
types.put(lower, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user