Regression introduced by the fix of PY-19192 fixed

The root remote path of a path mapping should be replaceable itself. Regression caught by PyRemotePathMapperTest.testReplicatedFolderInsideSysPath().
This commit is contained in:
Alexander Koshevoy
2016-05-10 19:26:58 +03:00
parent 602d836d20
commit 37b8d07b15
@@ -345,6 +345,7 @@ public class PathMappingSettings extends AbstractPathMapper implements Cloneable
private static boolean canReplaceRemote(@NotNull String path, @NotNull String remotePrefix) {
path = norm(path);
remotePrefix = norm(remotePrefix);
return path.startsWith(remotePrefix) && (remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/"));
return path.startsWith(remotePrefix) &&
(path.length() == remotePrefix.length() || remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/"));
}
}