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:
@@ -213,7 +213,7 @@ public class ChangeUtil {
|
||||
}
|
||||
Change changeToRevert = db.get().changes().get(changeIdToRevert);
|
||||
|
||||
Project.NameKey project = ctl.getChange().getProject();
|
||||
Project.NameKey project = ctl.getProject().getNameKey();
|
||||
try (Repository git = gitManager.openRepository(project);
|
||||
RevWalk revWalk = new RevWalk(git)) {
|
||||
RevCommit commitToRevert =
|
||||
@@ -309,7 +309,7 @@ public class ChangeUtil {
|
||||
}
|
||||
|
||||
try (Repository git =
|
||||
gitManager.openRepository(notes.getChange().getProject());
|
||||
gitManager.openRepository(notes.getProjectName());
|
||||
RevWalk revWalk = new RevWalk(git)) {
|
||||
RevCommit commit = revWalk.parseCommit(
|
||||
ObjectId.fromString(ps.getRevision().get()));
|
||||
|
||||
Reference in New Issue
Block a user