From 8456927b1bbb344cc6a768b1f491dddd50d4ce7c Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Thu, 6 Nov 2014 19:01:23 +0100 Subject: Make sure checkout doesn't report conflicts on ignored paths In a situation where a certain path was ignored but a working tree file with this path existed jgit didn't allow to checkout a branch which didn't ignore this path but contained different content. JGit considered this to be a checkout conflict to prevent overwriting the file in the working tree and raised an error. This commit fixes this by ensuring that ignored dirty working tree files don't lead to a checkout conflict. Bug: 450169 Change-Id: I90288d314ffac73c24a9c70a5181f8243bd4679a Signed-off-by: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache') 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 4b0d58600f..9f340c1191 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -698,7 +698,7 @@ public class DirCacheCheckout { // Nothing in Index // At least one of Head, Index, Merge is not empty // make sure not to overwrite untracked files - if (f != null) { + if (f != null && !f.isEntryIgnored()) { // A submodule is not a file. We should ignore it if (!FileMode.GITLINK.equals(mMode)) { // a dirty worktree: the index is empty but we have a -- cgit v1.2.3