Automatically set patch description for message edits
This is a port-forward of https://gerrit-review.googlesource.com/c/93712, but specific to the new PUT /changes/<id>/message API. Bug: Issue 6502 Change-Id: I3ee5a609065d66d2d328670571355f9e4a329bb6
This commit is contained in:
@@ -2926,6 +2926,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
RevisionApi rApi = gApi.changes().id(r.getChangeId()).current();
|
||||
assertThat(rApi.files().keySet()).containsExactly("/COMMIT_MSG", "a.txt");
|
||||
assertThat(getCommitMessage(r.getChangeId())).isEqualTo(newMessage);
|
||||
assertThat(rApi.description()).isEqualTo("Edit commit message");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ public class PutMessage
|
||||
psInserterFactory.create(resource.getControl(), psId, newCommit);
|
||||
inserter.setMessage(
|
||||
String.format("Patch Set %s: Commit message was updated.", psId.getId()));
|
||||
inserter.setDescription("Edit commit message");
|
||||
inserter.setNotify(input.notify);
|
||||
inserter.setAccountsToNotify(notifyUtil.resolveAccounts(input.notifyDetails));
|
||||
bu.addOp(resource.getChange().getId(), inserter);
|
||||
|
||||
Reference in New Issue
Block a user