diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2011-12-15 18:58:48 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-12-15 18:58:48 -0500 |
commit | 78ebffd5f4a65a098a2a41b241747c54905be63d (patch) | |
tree | d0eb1101f84c4223ab7548786dbf1eb9ffd80e99 | |
parent | e178ba20d096e9b1572b2fdeb5b1e207ea55802c (diff) | |
parent | 720119744f6c93c2ef3983067e48eb8e133129d1 (diff) | |
download | jgit-78ebffd5f4a65a098a2a41b241747c54905be63d.tar.gz jgit-78ebffd5f4a65a098a2a41b241747c54905be63d.zip |
Merge "Fix MergeCommandTest to pass if File.executable is not supported" into stable-1.2
-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 { |