aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2010-09-06 07:09:35 (EDT)
committerJens Baumgart2010-09-06 07:09:35 (EDT)
commit37f23e1fbfa19c22ae40c8a8469f3cc1b2938e85 (patch)
treeb49edc41bea9b0de503b6b8b5bd46069c91a29ea
parentaa7b1ea7ddab6f32d2d6ca0c5d7f5b487ebd4306 (diff)
downloadegit-37f23e1fbfa19c22ae40c8a8469f3cc1b2938e85.zip
egit-37f23e1fbfa19c22ae40c8a8469f3cc1b2938e85.tar.gz
egit-37f23e1fbfa19c22ae40c8a8469f3cc1b2938e85.tar.bz2
Fix IgnoreOperationTestrefs/changes/36/1536/1
IgnoreOperationTest did not clean up .gitignore in the workspace folder. This caused subsequent test to fail. Change-Id: Icc3e3e02302a8189ae2009e24682206d8bff086e Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java
index 664335f..f6574c8 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.io.IOException;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
@@ -42,6 +43,15 @@ public class IgnoreOperationTest extends GitTestCase {
@After
public void tearDown() throws Exception {
testRepository.dispose();
+ // delete gitignore file in workspace folder
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ File rootFile = root.getRawLocation().toFile();
+ File ignoreFile = new File(rootFile, Constants.GITIGNORE_FILENAME);
+ if (ignoreFile.exists()) {
+ if (!ignoreFile.delete())
+ throw new IOException(ignoreFile + " in use or undeletable");
+ assert !ignoreFile.exists();
+ }
super.tearDown();
}