Replace calls of ChangeNotes#getChange()

In future a change from ChangeNotes is only available after the notes
have been loaded, but project and change ID are known before. Avoid
calling getChange() when only project and change ID are required so
that loading the notes is not required in this case.

Change-Id: I172d94e9550c28797f0a7a6b20c4b4bc64e9dbfc
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-01-29 14:59:33 +01:00
parent 416dd77400
commit 0c133c550d
7 changed files with 13 additions and 12 deletions

View File

@@ -903,7 +903,7 @@ public class ChangeHookRunner implements ChangeHooks, EventDispatcher,
@Override
public PatchSetAttribute get() {
try (Repository repo =
repoManager.openRepository(notes.getChange().getProject());
repoManager.openRepository(notes.getProjectName());
RevWalk revWalk = new RevWalk(repo)) {
return eventFactory.asPatchSetAttribute(
revWalk, notes, patchSet);