commit | 03d668756b2cbfb5aac3a8d55a344dd79e40a2f6 | [log] [tgz] |
---|---|---|
author | Makson Lee <cdlee123@gmail.com> | Wed Nov 01 05:45:49 2017 +0000 |
committer | Makson Lee <cdlee123@gmail.com> | Wed Nov 01 05:54:13 2017 +0000 |
tree | ad75c10539e6a19d3fbc8ace6288d37e476ae8ad | |
parent | 270d105479e59281726a4e9f423644c316965535 [diff] |
Remove project in notdefault group from canonical manifest Change-Id: I0e30e70da16a325674950353cc8899c5d52868d0
diff --git a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/CanonicalManifest.java b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/CanonicalManifest.java index 5508cfc..a824475 100644 --- a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/CanonicalManifest.java +++ b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/CanonicalManifest.java
@@ -62,6 +62,8 @@ // Clear remove project after all include manifest is processed manifest.getRemoveProject().clear(); + removeNotDefaultProject(manifest); + return manifest; } @@ -135,4 +137,16 @@ resolveRemoveProject(manifest, removeProjects); } } + + private void removeNotDefaultProject(Manifest manifest) { + Project p; + Iterator<Project> i = manifest.getProject().listIterator(); + while (i.hasNext()) { + p = i.next(); + + if (p.getGroups() != null && p.getGroups().contains("notdefault")) { + i.remove(); + } + } + } }