Set commit ID in result of the /changes/*/revisions/*/commit endpoint
Setting the commit ID is important when a revision ID other than a commit ID is used, e.g. a legacy numeric patch set number, or the literal 'current'. Also explain in the documentation in which case the commit ID is not set. Change-Id: Iadcff2c7cbe98be8c826a0ea6d0aa8bd8ff2a6be Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -54,6 +54,7 @@ public class GetCommit implements RestReadView<RevisionResource> {
|
||||
rw.parseBody(commit);
|
||||
CommitInfo info = json.create(ChangeJson.NO_OPTIONS)
|
||||
.toCommit(rsrc.getControl(), rw, commit, addLinks);
|
||||
info.commit = commit.name();
|
||||
Response<CommitInfo> r = Response.ok(info);
|
||||
if (rsrc.isCacheable()) {
|
||||
r.caching(CacheControl.PRIVATE(7, TimeUnit.DAYS));
|
||||
|
Reference in New Issue
Block a user