diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-12-15 23:33:00 +0100 |
---|---|---|
committer | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-12-15 23:36:14 +0100 |
commit | 720119744f6c93c2ef3983067e48eb8e133129d1 (patch) | |
tree | 287a76f76a950d0eb290fbfde2a392e06e5496e6 | |
parent | 3c544647b7b3b291ad1f3661881f6d3bf9f90da4 (diff) | |
download | jgit-720119744f6c93c2ef3983067e48eb8e133129d1.tar.gz jgit-720119744f6c93c2ef3983067e48eb8e133129d1.zip |
Fix MergeCommandTest to pass if File.executable is not supported
Change-Id: If11080ed6e53d9df88a1ae42f48ee8914d54669b
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java | 16 |
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 { |