Merge "Fix: `gerrit review` with --message does not work with no labels" into stable-2.6
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java
index 48e175d..5769a22 100644
--- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java
+++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java
@@ -218,10 +218,8 @@
 
   private void applyReview(final ChangeControl ctl, final PatchSet patchSet,
       final PostReview.Input review) throws Exception {
-    if (!review.labels.isEmpty()) {
-      reviewProvider.get().apply(new RevisionResource(
-          new ChangeResource(ctl), patchSet), review);
-    }
+    reviewProvider.get().apply(new RevisionResource(
+        new ChangeResource(ctl), patchSet), review);
   }
 
   private void approveOne(final PatchSet patchSet) throws Exception {
@@ -246,7 +244,7 @@
     // If review labels are being applied, the comment will be included
     // on the review note. We don't need to add it again on the abandon
     // or restore comment.
-    if (!review.labels.isEmpty()) {
+    if (!review.labels.isEmpty() && (abandonChange || restoreChange)) {
       changeComment = null;
     }