Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2015-10-17 19:48:55 +0000
committerThomas Wolf2015-10-17 20:10:38 +0000
commit0c7c118bdc26e1dff2b8e8636e69f2e1d08705cc (patch)
tree2cd484aaeec05717088a2d917120294308f41202 /org.eclipse.egit.ui.test
parent5c9da573d8ec812608e1b21f94997b926586e2dc (diff)
downloadegit-0c7c118bdc26e1dff2b8e8636e69f2e1d08705cc.tar.gz
egit-0c7c118bdc26e1dff2b8e8636e69f2e1d08705cc.tar.xz
egit-0c7c118bdc26e1dff2b8e8636e69f2e1d08705cc.zip
Don't delete projects on disk unless the user said so
If the user chooses not to delete the working tree when deleting a repository the projects from that repository must not be deleted but only removed from the workspace if the "Remove projects from workspace" option is checked. Bug: 479964 Change-Id: I4435d049703f207224b0847a20742d240483abdf Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
index aa6ebb1645..93269f6400 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.egit.ui.view.repositories;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -22,6 +23,7 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jgit.api.SubmoduleAddCommand;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.junit.Before;
@@ -79,6 +81,45 @@ public class GitRepositoriesViewRepoDeletionTest extends
}
@Test
+ public void testDeleteRepositoryKeepProjectsBug479964() throws Exception {
+ deleteAllProjects();
+ assertProjectExistence(PROJ1, false);
+ clearView();
+ Activator.getDefault().getRepositoryUtil()
+ .addConfiguredRepository(repositoryFile);
+ shareProjects(repositoryFile);
+ assertProjectExistence(PROJ1, true);
+ refreshAndWait();
+ assertHasRepo(repositoryFile);
+ SWTBotTree tree = getOrOpenView().bot().tree();
+ tree.getAllItems()[0].select();
+ ContextMenuHelper.clickContextMenu(tree, myUtil
+ .getPluginLocalizedValue(DELETE_REPOSITORY_CONTEXT_MENU_LABEL));
+ SWTBotShell shell = bot.shell(
+ UIText.DeleteRepositoryConfirmDialog_DeleteRepositoryWindowTitle);
+ shell.activate();
+ shell.bot()
+ .checkBox(
+ UIText.DeleteRepositoryConfirmDialog_DeleteGitDirCheckbox)
+ .select();
+ SWTBotCheckBox checkbox = shell.bot().checkBox(
+ UIText.DeleteRepositoryConfirmDialog_DeleteWorkingDirectoryCheckbox);
+ checkbox.select();
+ checkbox.deselect();
+ // Now "Remove project from workspace" is selected, but "Delete working
+ // tree" is not.
+ shell.bot().button(IDialogConstants.OK_LABEL).click();
+ TestUtil.joinJobs(JobFamilies.REPOSITORY_DELETE);
+
+ refreshAndWait();
+ assertEmpty();
+ assertProjectExistence(PROJ1, false);
+ assertFalse(repositoryFile.exists());
+ assertTrue(
+ new File(repositoryFile.getParentFile(), PROJ1).isDirectory());
+ }
+
+ @Test
public void testDeleteSubmoduleRepository() throws Exception {
deleteAllProjects();
assertProjectExistence(PROJ1, false);

Back to the top