]> source.dussan.org Git - jgit.git/commit
DirCacheCheckout: Fix handling of files not in index 59/7259/2
authorRobin Stocker <robin@nibor.org>
Thu, 16 Aug 2012 14:06:58 +0000 (16:06 +0200)
committerRobin Stocker <robin@nibor.org>
Sat, 1 Sep 2012 11:29:00 +0000 (13:29 +0200)
commit51c20b27acdef57dcb1d79ac995cd49f2e9c2f91
tree6345c54adcd3fa5074dba16f445cb33bf3e8c562
parent0a9e010e14c96d97e902bf3c46ac1487ed6fbc18
DirCacheCheckout: Fix handling of files not in index

When a file is not in the index and neither contents nor mode differ
between "head" and "merge", the index state should be kept. If they
differ, a checkout conflict should occur. This is described in Git's
git-read-tree.txt.

JGit used to replace the index state with "merge" in both of the above
cases.

A confusing effect of this was that when one removed a file and then did
a rebase, the file silently reappeared again.

The changes to dir/file conflict handling are a consequence of this
change, as the index handling change made tests in DirCacheCheckoutTest
break. I compared these cases to C Git and the new behavior there also
matches what C Git does.

Bug: 387390
Change-Id: I5beb781f12172a68f98c67d4c8029eb51ceae62d
Signed-off-by: Robin Stocker <robin@nibor.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java