aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java8
2 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index 1b4a9ff231..90a3f94167 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -128,11 +128,14 @@ public class DirCacheCheckoutTest extends ReadTreeTest {
RevCommit topic = git.commit().setMessage("topic-1").call();
assertIndex(mkmap("f", "f()\nside", "G/i", "i()"));
+ writeTrashFile("untracked", "untracked");
+
resetHard(master);
assertIndex(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h", "h()"));
resetHard(topic);
assertIndex(mkmap("f", "f()\nside", "G/i", "i()"));
- assertWorkDir(mkmap("f", "f()\nside", "G/i", "i()"));
+ assertWorkDir(mkmap("f", "f()\nside", "G/i", "i()", "untracked",
+ "untracked"));
assertEquals(MergeStatus.CONFLICTING, git.merge().include(master)
.call().getMergeStatus());
@@ -143,7 +146,7 @@ public class DirCacheCheckoutTest extends ReadTreeTest {
resetHard(master);
assertIndex(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h", "h()"));
assertWorkDir(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h",
- "h()"));
+ "h()", "untracked", "untracked"));
}
private DirCacheCheckout resetHard(RevCommit commit)
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 9b0bc7b01c..25acf16a35 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -351,12 +351,8 @@ public class DirCacheCheckout {
remove(i.getEntryPathString());
conflicts.remove(i.getEntryPathString());
} else {
- // We are about to remove an untracked file. Check that
- // it is ignored - otherwise that's an conflict
- if (!f.isEntryIgnored())
- conflicts.add(walk.getPathString());
- else
- remove(f.getEntryPathString());
+ // untracked file, neither contained in tree to merge
+ // nor in index
}
}
} else {