mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:10:43 +07:00
IJPL-156389 lvcs: fix Local History for WSL projects
GitOrigin-RevId: 932821c3e0c422a1dcfb08d19cf675f16d7559a7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fd30803a4e
commit
58af8101d9
@@ -103,7 +103,10 @@ public class IdeaGateway {
|
||||
|
||||
public static @NotNull String getNameOrUrlPart(@NotNull VirtualFile file) {
|
||||
String name = file.getName();
|
||||
if (file.isInLocalFileSystem() || file.getParent() != null) return name;
|
||||
if (file.getParent() != null) return name;
|
||||
if (file.isInLocalFileSystem()) {
|
||||
return "/".equals(name) ? "" : name; // on Unix FS root name is "/"
|
||||
}
|
||||
return VirtualFileManager.constructUrl(file.getFileSystem().getProtocol(), StringUtil.trimStart(name, "/"));
|
||||
}
|
||||
|
||||
@@ -399,7 +402,7 @@ public class IdeaGateway {
|
||||
return true;
|
||||
}
|
||||
|
||||
String childName = StringUtil.trimStart(getNameOrUrlPart(child), "/"); // on Mac FS root name is "/"
|
||||
String childName = getNameOrUrlPart(child);
|
||||
if (!targetPath.startsWith(childName)) return false;
|
||||
String targetPathRest = targetPath.substring(childName.length());
|
||||
if (!targetPathRest.isEmpty() && targetPathRest.charAt(0) != '/') return false;
|
||||
|
||||
Reference in New Issue
Block a user