Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg2011-12-15 22:33:00 +0000
committerRobin Rosenberg2011-12-15 22:36:14 +0000
commit720119744f6c93c2ef3983067e48eb8e133129d1 (patch)
tree287a76f76a950d0eb290fbfde2a392e06e5496e6
parent3c544647b7b3b291ad1f3661881f6d3bf9f90da4 (diff)
downloadjgit-720119744f6c93c2ef3983067e48eb8e133129d1.tar.gz
jgit-720119744f6c93c2ef3983067e48eb8e133129d1.tar.xz
jgit-720119744f6c93c2ef3983067e48eb8e133129d1.zip
Fix MergeCommandTest to pass if File.executable is not supported
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
index d1aaa0a5f8..30a94520d1 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
@@ -60,6 +60,7 @@ import org.eclipse.jgit.lib.RepositoryTestCase;
import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.FileUtils;
import org.junit.Test;
import org.junit.experimental.theories.DataPoints;
@@ -1025,6 +1026,9 @@ public class MergeCommandTest extends RepositoryTestCase {
@Test
public void testFileModeMerge() throws Exception {
+ if (!FS.DETECTED.supportsExecute())
+ return;
+ // Only Java6
Git git = new Git(db);
writeTrashFile("mergeableMode", "a");
@@ -1061,6 +1065,10 @@ public class MergeCommandTest extends RepositoryTestCase {
@Test
public void testFileModeMergeWithDirtyWorkTree() throws Exception {
+ if (!FS.DETECTED.supportsExecute())
+ return;
+ // Only Java6 (or set x bit in index)
+
Git git = new Git(db);
writeTrashFile("mergeableButDirty", "a");
@@ -1089,13 +1097,13 @@ public class MergeCommandTest extends RepositoryTestCase {
}
private void setExecutable(Git git, String path, boolean executable) {
- new File(git.getRepository().getWorkTree(), path)
- .setExecutable(executable);
- assertEquals(executable, canExecute(git, path));
+ FS.DETECTED.setExecute(
+ new File(git.getRepository().getWorkTree(), path), executable);
}
private boolean canExecute(Git git, String path) {
- return (new File(git.getRepository().getWorkTree(), path).canExecute());
+ return FS.DETECTED.canExecute(new File(git.getRepository()
+ .getWorkTree(), path));
}
private RevCommit addAllAndCommit(final Git git) throws Exception {

Back to the top