summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java5
2 files changed, 6 insertions, 2 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 292206e539..dd9023fc77 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1129,7 +1129,8 @@ public class DirCacheCheckout {
if (!tmpFile.renameTo(f)) {
// tried to rename which failed. Let' delete the target file and try
// again
- FileUtils.delete(f);
+ FileUtils.delete(f, FileUtils.EMPTY_DIRECTORIES_ONLY
+ | FileUtils.RECURSIVE);
if (!tmpFile.renameTo(f)) {
throw new IOException(MessageFormat.format(
JGitText.get().couldNotWriteFile, tmpFile.getPath(),
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
index bea2119333..213a1d4daa 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -621,7 +621,10 @@ public class ResolveMerger extends ThreeWayMerger {
boolean isDirty = work.isModeDifferent(modeO);
if (!isDirty && nonTree(modeF))
isDirty = !tw.idEqual(T_FILE, T_OURS);
-
+ // Ignore existing empty directories
+ if (isDirty && modeF == FileMode.TYPE_TREE
+ && modeO == FileMode.TYPE_MISSING)
+ isDirty = false;
if (isDirty)
failingPaths.put(tw.getPathString(),
MergeFailureReason.DIRTY_WORKTREE);