From a0dd09b31f05ea73d5f46ef1f721a05d7d74ee72 Mon Sep 17 00:00:00 2001 From: "Nikolay.Rykunov" Date: Mon, 1 Apr 2019 15:05:11 +0300 Subject: [PATCH] Use Change instead of VirtualFile to get FilePath getFilePath from VirtualFile takes a lot of time to access the disk --- .../changeReminder/src/com/jetbrains/changeReminder/util.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/changeReminder/src/com/jetbrains/changeReminder/util.kt b/plugins/changeReminder/src/com/jetbrains/changeReminder/util.kt index 5bfe92a0a2be..fe4d2dac3063 100644 --- a/plugins/changeReminder/src/com/jetbrains/changeReminder/util.kt +++ b/plugins/changeReminder/src/com/jetbrains/changeReminder/util.kt @@ -10,7 +10,6 @@ import com.intellij.openapi.vcs.changes.ChangesUtil import com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog import com.intellij.openapi.vfs.VirtualFile import com.intellij.util.Consumer -import com.intellij.vcsUtil.VcsUtil import com.jetbrains.changeReminder.predict.PredictedChange import com.jetbrains.changeReminder.predict.PredictedFilePath import git4idea.GitCommit @@ -31,8 +30,8 @@ fun CheckinProjectPanel.isAmend(): Boolean { fun CheckinProjectPanel.getGitRootFiles(project: Project): Map> { val rootFiles = HashMap>() - this.files.forEach { file -> - val filePath = VcsUtil.getFilePath(file.absolutePath) + this.selectedChanges.forEach { file -> + val filePath = ChangesUtil.getFilePath(file) val fileVcs = ProjectLevelVcsManager.getInstance(project).getVcsRootObjectFor(filePath) if (fileVcs != null && fileVcs.vcs is GitVcs) { val fileRoot = fileVcs.path