From 59eae52e9d6e14288a4dc80cedc05ca91c2112ae Mon Sep 17 00:00:00 2001 From: Yang Zhenhui Date: Tue, 15 May 2012 16:57:35 +0800 Subject: [PATCH] Do not automatically add author/committer as reviewer to drafts Currently if you take an existing commit and push it as a draft on another branch (or project), the original author and committer are automatically added as a reviewer. This is not good, since drafts are supposed to be invisible to anyone except the change owner and the reviewers he adds. Change-Id: Id83e5dd2ef9472618b0dbbefa2979c08acda73d0 --- .../src/main/java/com/google/gerrit/server/ApprovalsUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/ApprovalsUtil.java b/gerrit-server/src/main/java/com/google/gerrit/server/ApprovalsUtil.java index 556ae82d6d..a295c49d0e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/ApprovalsUtil.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/ApprovalsUtil.java @@ -124,14 +124,14 @@ public class ApprovalsUtil { Account.Id authorId = info.getAuthor() != null ? info.getAuthor().getAccount() : null; - if (authorId != null) { + if (authorId != null && !ps.isDraft()) { need.add(authorId); } Account.Id committerId = info.getCommitter() != null ? info.getCommitter().getAccount() : null; - if (committerId != null) { + if (committerId != null && !ps.isDraft()) { need.add(committerId); } need.remove(change.getOwner());