Refactor ChangeInserter's setDraft to match PatchSetInserter's
The `setDraft` method in ChangeInserter can only set the status to draft; it cannot toggle it. Change it to be able to toggle the status between draft and new, making it consistent with the way the method of the same name works in PatchSetInserter. Change-Id: Iead2e62701c6b5c90a33efcda35b2e144fd67ccf
This commit is contained in:
@@ -107,9 +107,9 @@ public class ChangeInserter {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChangeInserter setDraft() {
|
||||
change.setStatus(Change.Status.DRAFT);
|
||||
patchSet.setDraft(true);
|
||||
public ChangeInserter setDraft(boolean draft) {
|
||||
change.setStatus(draft ? Change.Status.DRAFT : Change.Status.NEW);
|
||||
patchSet.setDraft(draft);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user