diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/RegexTopicPredicate.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/RegexTopicPredicate.java index 2d6567094b..a02edd15a3 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/RegexTopicPredicate.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/RegexTopicPredicate.java @@ -14,7 +14,7 @@ package com.google.gerrit.server.query.change; -import static com.google.gerrit.server.index.change.ChangeField.FUZZY_TOPIC; +import static com.google.gerrit.server.index.change.ChangeField.EXACT_TOPIC; import com.google.gerrit.reviewdb.client.Change; import com.google.gwtorm.server.OrmException; @@ -26,7 +26,7 @@ class RegexTopicPredicate extends ChangeRegexPredicate { private final RunAutomaton pattern; RegexTopicPredicate(String re) { - super(FUZZY_TOPIC, re); + super(EXACT_TOPIC, re); if (re.startsWith("^")) { re = re.substring(1); diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java b/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java index 0c658bf972..caf8238025 100644 --- a/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java +++ b/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java @@ -507,6 +507,8 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests { assertQuery("intopic:fixup", change4); assertQuery("topic:\"\"", change5); assertQuery("intopic:\"\"", change5); + assertQuery("intopic:^feature2.*", change4, change2); + assertQuery("intopic:{^.*feature2$}", change3, change2); } @Test