summaryrefslogtreecommitdiff
path: root/platform/lvcs-impl
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-19 12:53:10 -0700
committerTor Norbye <tnorbye@google.com>2014-08-19 12:53:10 -0700
commit02cf98d65c798d368fcec43ed64a001d513bdd4f (patch)
treee39e210ab20917b7e5ffdce14a42f5747506eed0 /platform/lvcs-impl
parent2e5965e996aad62ab1338b09d54caaf99ff3dd6a (diff)
downloadidea-02cf98d65c798d368fcec43ed64a001d513bdd4f.tar.gz
Snapshot idea/138.1503 from git://git.jetbrains.org/idea/community.git
Change-Id: Ie01af1d8710ec0ff51d90301bda1a18b0b5c0faf
Diffstat (limited to 'platform/lvcs-impl')
-rw-r--r--platform/lvcs-impl/src/com/intellij/history/core/Paths.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/platform/lvcs-impl/src/com/intellij/history/core/Paths.java b/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
index 440fd699ef7d..bd98591b4cb3 100644
--- a/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
+++ b/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
@@ -67,9 +67,18 @@ public class Paths {
}
public static Iterable<String> split(String path) {
- Iterable<String> result = StringUtil.tokenize(path, String.valueOf(DELIM));
- if (path.indexOf(DELIM) == 0) {
- result = ContainerUtil.concat(Collections.singleton(String.valueOf(DELIM)), result);
+ //must be consistent with LocalFileSystemBase.extractRootPath()
+ int prefixLen = 0;
+ if (path.startsWith("//")) {
+ prefixLen = path.indexOf(DELIM, 2);
+ if (prefixLen == -1) prefixLen = path.length();
+ }
+ else if (StringUtil.startsWithChar(path, DELIM)) {
+ prefixLen = 1;
+ }
+ Iterable<String> result = StringUtil.tokenize(path.substring(prefixLen), String.valueOf(DELIM));
+ if (prefixLen > 0) {
+ result = ContainerUtil.concat(Collections.singleton(path.substring(0, prefixLen)), result);
}
return result;
}