Fix: draft patch set is published by cherrypicking

If a draft patch set is cherrypicked onto the same destination
change, i.e. as a shortcut to rebasing, the newly created patch
set is not draft.

Set the draft status of the newly created patch set to the same
as the source patch set.

Change-Id: I1e6e123171ee4257a784ab79f520810975b45644
This commit is contained in:
David Pursehouse
2013-10-11 19:38:38 +09:00
parent f63ec844b5
commit 9eca11e0a8

View File

@@ -196,8 +196,10 @@ public class CherryPickChange {
final PatchSetInserter inserter = patchSetInserterFactory
.create(git, revWalk, refControl, currentUser, change, cherryPickCommit);
final PatchSet.Id newPatchSetId = inserter.getPatchSetId();
final PatchSet current = db.patchSets().get(change.currentPatchSetId());
inserter
.setMessage("Uploaded patch set " + newPatchSetId.get() + ".")
.setDraft(current.isDraft())
.insert();
return change.getId();
}