aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/dircache
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index 22090f5b60..6bc2946078 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1301,14 +1301,6 @@ public class DirCacheCheckout {
JGitText.get().cannotDeleteFile, c));
removeEmptyParents(conflict);
}
- for (String r : removed) {
- File file = new File(repo.getWorkTree(), r);
- if (!file.delete())
- throw new CheckoutConflictException(
- MessageFormat.format(JGitText.get().cannotDeleteFile,
- file.getAbsolutePath()));
- removeEmptyParents(file);
- }
}
/**
@@ -1473,6 +1465,9 @@ public class DirCacheCheckout {
ObjectLoader ol = or.open(entry.getObjectId());
File f = new File(repo.getWorkTree(), entry.getPathString());
File parentDir = f.getParentFile();
+ if (parentDir.isFile()) {
+ FileUtils.delete(parentDir);
+ }
FileUtils.mkdirs(parentDir, true);
FS fs = repo.getFS();
WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY);