summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMariot Chauvin2010-12-13 04:09:57 (EST)
committer Matthias Sohn2010-12-13 04:09:57 (EST)
commit8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd (patch)
tree62d8bbbce379327312e56da87b374b687e75be50
parent46577ed73b032af68678c111ab6531d9a0e5db64 (diff)
downloadegit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.zip
egit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.tar.gz
egit-8ed62421cecbfeb619e8be1bb3232f33c0a7b7dd.tar.bz2
Do not try to delete an already deleted folderrefs/changes/07/2107/1
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 35b5f01..2ab197c 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);