From b90fd10fe72836eeff1df9c68b13b7f1cc412f2a Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Tue, 9 Jun 2020 21:21:56 +0300 Subject: [PATCH] [git-index] unwrap pce thrown during GitIndexVirtualFile creation GitOrigin-RevId: 0c7e7ac8b90a51d2576c134c36ac28d7fe51803c --- .../git4idea/index/vfs/GitIndexVirtualFileCache.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/index/vfs/GitIndexVirtualFileCache.kt b/plugins/git4idea/src/git4idea/index/vfs/GitIndexVirtualFileCache.kt index 56bc08e85606..30a4b71f99d1 100644 --- a/plugins/git4idea/src/git4idea/index/vfs/GitIndexVirtualFileCache.kt +++ b/plugins/git4idea/src/git4idea/index/vfs/GitIndexVirtualFileCache.kt @@ -3,7 +3,9 @@ package git4idea.index.vfs import com.google.common.cache.CacheBuilder import com.google.common.cache.CacheLoader +import com.google.common.util.concurrent.UncheckedExecutionException import com.intellij.openapi.Disposable +import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.project.Project import com.intellij.openapi.vcs.FilePath import com.intellij.openapi.vfs.VirtualFile @@ -14,7 +16,15 @@ class GitIndexVirtualFileCache(private val project: Project) : Disposable { }) fun get(root: VirtualFile, filePath: FilePath): GitIndexVirtualFile { - return cache.get(Key(root, filePath)) + try { + return cache.get(Key(root, filePath)) + } catch (e: UncheckedExecutionException) { + val cause = e.cause + if (cause is ProcessCanceledException) { + throw cause + } + throw e + } } fun filesMatching(function: (GitIndexVirtualFile) -> Boolean): List {