Make branch path look up more specific If we have the following branch path: m/master/default.xml m/master123/default.xml With previous implementation, when the default.xml manifest in master branch is updated both of the above monitor will be removed. This fix will only remove the first entry. This does not fix the following case: m/release/1.2/default.xml m/release/1.2/3/default.xml Change-Id: Ibfbfb1ca12a14d42c71073fa3cb61c47aaea86d6
diff --git a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/ManifestSubscription.java b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/ManifestSubscription.java index 49d78fd..08c6a24 100644 --- a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/ManifestSubscription.java +++ b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/ManifestSubscription.java
@@ -260,7 +260,7 @@ String branchPath; while (iter.hasNext()) { branchPath = iter.next(); - if (branchPath.startsWith(branchName)) { + if (branchPath.startsWith(branchName+"/")) { iter.remove(); manifestStores.remove(store, branchPath); manifestSource.remove(store, branchPath);