From 4288662868a83c4e9e3a70cf974ea8b4d38bf2db Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Fri, 13 Oct 2017 17:11:12 +0300 Subject: [PATCH] [git] cache root path in UnparsedChanges --- plugins/git4idea/src/git4idea/GitCommit.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/GitCommit.java b/plugins/git4idea/src/git4idea/GitCommit.java index 522a9bb846d9..77ffccefe257 100644 --- a/plugins/git4idea/src/git4idea/GitCommit.java +++ b/plugins/git4idea/src/git4idea/GitCommit.java @@ -94,6 +94,8 @@ public final class GitCommit extends VcsChangesLazilyParsedDetails { } private class UnparsedChanges extends VcsChangesLazilyParsedDetails.UnparsedChanges { + @NotNull private final String myRootPath = getRoot().getPath(); + private UnparsedChanges(@NotNull Project project, @NotNull List> changesOutput) { super(project, changesOutput, new GitChangesDescriptor()); @@ -102,10 +104,10 @@ public final class GitCommit extends VcsChangesLazilyParsedDetails { @NotNull protected String absolutePath(@NotNull String path) { try { - return getRoot().getPath() + "/" + GitUtil.unescapePath(path); + return myRootPath + "/" + GitUtil.unescapePath(path); } catch (VcsException e) { - return getRoot().getPath() + "/" + path; + return myRootPath + "/" + path; } }