From 3a23e3f6d1038e5ab3dd994f77166f2bbe456fa6 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 2 Sep 2016 11:49:13 +0300 Subject: [PATCH] [updater] fixes FS case-sensitivity detection --- updater/src/com/intellij/updater/Runner.java | 3 ++- updater/testSrc/com/intellij/updater/PatchTest.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/updater/src/com/intellij/updater/Runner.java b/updater/src/com/intellij/updater/Runner.java index 15ba43271a5b..654e120fc0de 100644 --- a/updater/src/com/intellij/updater/Runner.java +++ b/updater/src/com/intellij/updater/Runner.java @@ -106,7 +106,8 @@ public class Runner { } public static void checkCaseSensitivity(String path) { - ourCaseSensitiveFs = new File(path.toUpperCase()).exists() != new File(path.toLowerCase()).exists(); + boolean orig = new File(path).exists(); + ourCaseSensitiveFs = orig != new File(path.toUpperCase()).exists() || orig != new File(path.toLowerCase()).exists(); } private static Map buildWarningMap(List warnings) { diff --git a/updater/testSrc/com/intellij/updater/PatchTest.java b/updater/testSrc/com/intellij/updater/PatchTest.java index f5af59df4793..89a0c40806f6 100644 --- a/updater/testSrc/com/intellij/updater/PatchTest.java +++ b/updater/testSrc/com/intellij/updater/PatchTest.java @@ -135,6 +135,8 @@ public class PatchTest extends PatchTestCase { @Test public void testValidatingCaseOnlyRenameWithConflict() throws Exception { + assertThat(Runner.isCaseSensitiveFs()).isEqualTo(SystemInfo.isFileSystemCaseSensitive); + Patch patch = createCaseOnlyRenamePatch(); FileUtil.writeToFile(new File(myOlderDir, "bin/IDEA.bat"), FileUtil.loadFileBytes(new File(myOlderDir, "bin/idea.bat")));