]> source.dussan.org Git - jgit.git/commit
CheckoutCommand: force flag now allows overwrite 23/127823/9
authorNed Twigg <ned.twigg@diffplug.com>
Tue, 21 Aug 2018 21:44:28 +0000 (14:44 -0700)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Sat, 20 Oct 2018 10:53:23 +0000 (06:53 -0400)
commitd056a543846ccf9b8cd0f59cc2f5920427fc4559
tree65a9d3a675825c76b02d8ba0c701351ec8d24db1
parent36432ac4e36cf8d59e45877ea69de70354e0ca0b
CheckoutCommand: force flag now allows overwrite

Before this commit, a force checkout would fail if there
were any conflicting files. After this commit, a force
checkout will overwrite the conflicting files, as expected.

Making this work required fixing a bug in DirCacheCheckout.
Before this commit, when DirCacheCheckout had
failOnConflict=false, it would delete all conflicting files
from the working copy and just leave them missing. After
this commit, DirCacheCheckout overwrites conflicting files
with the merge tree.

This change in DirCacheCheckout causes "reset --hard" and
"revert --abort" to behave as expected (previously they
would simply delete conflicting files, now they will be
overwritten from the merge tree).

Change-Id: If7e328ee792ef6511ab7d9c26d8d77c39210ec9f
Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java