aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 664335f0a..f6574c83a 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();
}