commit | 857bfbce4ca466b1cb2c7a78d18b690271989545 | [log] [tgz] |
---|---|---|
author | Sven Selberg <svense@axis.com> | Wed Aug 25 14:40:12 2021 +0200 |
committer | Sven Selberg <sven.selberg@axis.com> | Wed Aug 25 12:58:53 2021 +0000 |
tree | 6043b689f5ecd6b9d223afd2a8a3f3ade9fdb76b | |
parent | 378d16f55307f6076fcb72bbbfa683ca6472c582 [diff] |
Don't call 'review' with empty ReviewInput Apart from being unnecessary, every call to 'review' will remove the ChangeOwner from the Attention-Set regardless of other states [1]. Not calling 'review' when not needed mitigates the effects of this bug. [1] https://bugs.chromium.org/p/gerrit/issues/detail?id=14941 Bug: Issue 14925 Change-Id: I314cfcb358ba08b1c1f5400dd7d6ec538342a99f
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewers/AddReviewers.java b/src/main/java/com/googlesource/gerrit/plugins/reviewers/AddReviewers.java index 43db627..80fab28 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/reviewers/AddReviewers.java +++ b/src/main/java/com/googlesource/gerrit/plugins/reviewers/AddReviewers.java
@@ -88,6 +88,9 @@ .filter(c -> !existingReviewers.contains(c)) .filter(r -> !reviewersToAdd.contains(r)) .collect(Collectors.toSet()); + if (reviewersToAdd.isEmpty() && ccsToAdd.isEmpty()) { + return; + } ReviewInput in = new ReviewInput(); in.reviewers = new ArrayList<>(reviewers.size() + ccs.size());