]> source.dussan.org Git - jgit.git/commitdiff
Allow detection of case insensitive file systems 28/6028/3
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 18 May 2012 14:52:50 +0000 (16:52 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 6 Aug 2012 19:34:57 +0000 (21:34 +0200)
Change-Id: I03f59d07bcc3338ef8d392cbd940799186ca03bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java

index fd74098496bb55a4da688c6321ca6e0d4b724304..ab2027ce72185dda5d0540ab7d9db0ba1b67b0e1 100644 (file)
@@ -631,6 +631,11 @@ public class AddCommandTest extends RepositoryTestCase {
                        public boolean canExecute(File f) {
                                return true;
                        }
+
+                       @Override
+                       public boolean isCaseSensitive() {
+                               return false;
+                       }
                };
 
                Git git = Git.open(db.getDirectory(), executableFs);
@@ -671,6 +676,11 @@ public class AddCommandTest extends RepositoryTestCase {
                        public boolean canExecute(File f) {
                                return false;
                        }
+
+                       @Override
+                       public boolean isCaseSensitive() {
+                               return false;
+                       }
                };
 
                config = db.getConfig();
index e558d61782bb3d0d8ec6da0c4c3fb804cb8df0b4..20d62f5316360bb09a06dfcdebcba0af1387445a 100644 (file)
@@ -109,6 +109,11 @@ public class CommitCommandTest extends RepositoryTestCase {
                        public boolean canExecute(File f) {
                                return true;
                        }
+
+                       @Override
+                       public boolean isCaseSensitive() {
+                               return true;
+                       }
                };
 
                Git git = Git.open(db.getDirectory(), executableFs);
@@ -149,6 +154,11 @@ public class CommitCommandTest extends RepositoryTestCase {
                        public boolean canExecute(File f) {
                                return false;
                        }
+
+                       @Override
+                       public boolean isCaseSensitive() {
+                               return true;
+                       }
                };
 
                config = db.getConfig();
index 0dfa51187cf487feb88b4fe2ecb294d1f363bf98..535d1cd26a003f18aa0929a5eb76355c4dac6ae1 100644 (file)
@@ -135,6 +135,13 @@ public abstract class FS {
         */
        public abstract boolean supportsExecute();
 
+       /**
+        * Is this file system case sensitive
+        *
+        * @return true if this implementation is case sensitive
+        */
+       public abstract boolean isCaseSensitive();
+
        /**
         * Determine if the file is executable (or not).
         * <p>
index f04bb6fe0c7673e672290eb788fa65b9fce325b0..36d3b9484a36b8da2e6ae599f766fcdbf78408c8 100644 (file)
@@ -85,6 +85,14 @@ abstract class FS_POSIX extends FS {
                super(src);
        }
 
+       @Override
+       public boolean isCaseSensitive() {
+               if (isMacOS())
+                       return false;
+               else
+                       return true;
+       }
+
        @Override
        public ProcessBuilder runInShell(String cmd, String[] args) {
                List<String> argv = new ArrayList<String>(4 + args.length);
index 58f7fb4bf858f9f9a0f1f811a49e19d99b4a3d7f..3b6704497cfd7cd45d4940c670a390fe005d2d90 100644 (file)
@@ -53,6 +53,7 @@ import java.util.Arrays;
 import java.util.List;
 
 class FS_Win32 extends FS {
+
        static boolean isWin32() {
                final String osDotName = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
@@ -88,6 +89,11 @@ class FS_Win32 extends FS {
                return false;
        }
 
+       @Override
+       public boolean isCaseSensitive() {
+               return false;
+       }
+
        @Override
        public boolean retryFailedLockFileCommit() {
                return true;