Parse body when creating CommitResource
GetCommit depends on the body of both the commit and parent being parsed, to get the subject. Change-Id: Ic33854a129926e4138e21a57e9218969486720be
This commit is contained in:
@@ -70,11 +70,12 @@ public class CommitsCollection implements
|
||||
RevWalk rw = new RevWalk(repo);
|
||||
try {
|
||||
RevCommit commit = rw.parseCommit(objectId);
|
||||
rw.parseBody(commit);
|
||||
if (!parent.getControl().canReadCommit(db.get(), rw, commit)) {
|
||||
throw new ResourceNotFoundException(id);
|
||||
}
|
||||
for (int i = 0; i < commit.getParentCount(); i++) {
|
||||
rw.parseCommit(commit.getParent(i));
|
||||
rw.parseBody(rw.parseCommit(commit.getParent(i)));
|
||||
}
|
||||
return new CommitResource(parent, commit);
|
||||
} catch (MissingObjectException | IncorrectObjectTypeException e) {
|
||||
|
Reference in New Issue
Block a user