Browse Source

Allow detection of case insensitive file systems

Change-Id: I03f59d07bcc3338ef8d392cbd940799186ca03bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
tags/v2.1.0.201209190230-r
Matthias Sohn 12 years ago
parent
commit
e9c811d0d0

+ 10
- 0
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java View 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();

+ 10
- 0
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java View 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();

+ 7
- 0
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java View 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>

+ 8
- 0
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java View 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);

+ 6
- 0
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java View 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;

Loading…
Cancel
Save