From 28f7f30cf405cda85fc292149a489f3d5b4dbe3a Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Tue, 12 May 2020 19:27:27 +0300 Subject: [PATCH] IDEA-172253 git: support WSL git executable for project in WSL file system GitOrigin-RevId: b35a187effb08ceeb9521c0f71de499216e55d67 --- .../src/com/intellij/execution/wsl/WSLDistribution.java | 2 +- plugins/git4idea/src/git4idea/config/GitExecutable.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java b/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java index 4bb295506e3a..6cefdb04e4c4 100644 --- a/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java +++ b/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java @@ -424,7 +424,7 @@ public class WSLDistribution { */ @ApiStatus.Experimental @NotNull - File getUNCRoot() { + public File getUNCRoot() { return new File(UNC_PREFIX + myDescriptor.getMsId()); } diff --git a/plugins/git4idea/src/git4idea/config/GitExecutable.kt b/plugins/git4idea/src/git4idea/config/GitExecutable.kt index 0d43f6f634be..407067643e99 100644 --- a/plugins/git4idea/src/git4idea/config/GitExecutable.kt +++ b/plugins/git4idea/src/git4idea/config/GitExecutable.kt @@ -66,8 +66,9 @@ sealed class GitExecutable { } override fun convertFilePathBack(path: String, workingDir: File): File { - val localPath = distribution.getWindowsPath(path) ?: path - return File(localPath) + val localPath = distribution.getWindowsPath(path) + if (localPath != null) return File(localPath) + return File(distribution.uncRoot, path) } override fun patchCommandLine(handler: GitHandler, commandLine: GeneralCommandLine, withLowPriority: Boolean, withNoTty: Boolean) {