Merge "Set commit ID in result of the /changes/*/revisions/*/commit endpoint"

This commit is contained in:
Edwin Kempin
2015-08-04 12:50:42 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -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));