]> source.dussan.org Git - jgit.git/commit
Fix handling of file/folder conflicts during a checkout 78/19078/3
authorChristian Halstrick <christian.halstrick@sap.com>
Thu, 28 Nov 2013 17:00:36 +0000 (18:00 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 29 Nov 2013 21:32:36 +0000 (22:32 +0100)
commitaf40635aba91a78ec248503906996ca89898e888
tree9a53aa91f4d04b88ba94458a3dd7d168a8263029
parent53c8ac0c6090a6f52fa70258cc5187cacfd065ff
Fix handling of file/folder conflicts during a checkout

JGit was not handling certain file/folder conflicts during a checkout
correctly. This was reported by Axel Richard in
http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02358.html.
This commit fixes this problem.

Still JGit behaves intentionally different than native git.
If HEAD contains a tree, and workingtree, Index and Merge contain a file
with same content ... then JGit allows a conflict free checkout of
Merge. Native git always complains that it doesn't want to overwrite
local changes. But there is no need to update the working tree because
Index and Merge are already equal.

A shell script which shows how native git behaves can be found here.
https://gist.github.com/chalstrick/7694959#file-gistfile1-sh

Change-Id: Ifd6a68974d61cd4fa23bc575f3a40773db66cafc
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java