ChangeRebuilderImpl: Omit empty group list from update
This allows us to properly convert old patch sets that never had groups applied. Without this change, we put an empty Groups footer, which results in the groups list [""] after NoteDb conversion, which doesn't match the null list prior to conversion. Add a case to ChangeRebuilderIT to verify. Change-Id: I2a54c89271965f97fd454b036e78d11229b1a3d7
This commit is contained in:
@@ -560,7 +560,10 @@ public class ChangeRebuilderImpl extends ChangeRebuilder {
|
||||
update.setSubjectForCommit("Create patch set " + ps.getPatchSetId());
|
||||
}
|
||||
setRevision(update, ps);
|
||||
update.setGroups(ps.getGroups());
|
||||
List<String> groups = ps.getGroups();
|
||||
if (!groups.isEmpty()) {
|
||||
update.setGroups(ps.getGroups());
|
||||
}
|
||||
if (ps.isDraft()) {
|
||||
update.setPatchSetState(PatchSetState.DRAFT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user