Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariot Chauvin2010-12-13 09:09:57 +0000
committerMatthias Sohn2010-12-13 09:09:57 +0000
commit8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd (patch)
tree62d8bbbce379327312e56da87b374b687e75be50
parent46577ed73b032af68678c111ab6531d9a0e5db64 (diff)
downloadegit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.tar.gz
egit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.tar.xz
egit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.zip
Do not try to delete an already deleted folder
Originally, the remove command tries to delete first the working directory (if repository has one) and then the metadata directory. However the metadata directory could be contained by the working directory and thus already deleted when the second deletion is called. In this case an IOException will be thrown, to indicate that the metadata directory could not be deleted. The correction simply checks that the metadata directory exists before trying to delete it. Bug: 332262 Change-Id: I6f49db1c8e730ab3c10d35e2af0e4dc81b5a223c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
index 35b5f01df0..2ab197c9dc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
@@ -167,8 +167,11 @@ public class RemoveCommand extends
for (RepositoryNode node : selectedNodes) {
Repository repo = node.getRepository();
if (!repo.isBare())
- FileUtils.delete(repo.getWorkTree(), FileUtils.RECURSIVE | FileUtils.RETRY);
- FileUtils.delete(repo.getDirectory(), FileUtils.RECURSIVE | FileUtils.RETRY);
+ FileUtils.delete(repo.getWorkTree(),
+ FileUtils.RECURSIVE | FileUtils.RETRY);
+ FileUtils.delete(repo.getDirectory(),
+ FileUtils.RECURSIVE | FileUtils.RETRY
+ | FileUtils.SKIP_MISSING);
}
} catch (IOException e) {
return Activator.createErrorStatus(e.getMessage(), e);

Back to the top