Add one more test to ReadTreeTest
Add an explicit test case to check that we don't overwrite dirty files in case Head & Index are equal. Change-Id: I6266d0a449e55369d2d0a048694dca5565c5fcf3 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
This commit is contained in:
parent
bc0359c42f
commit
0bdf73db7f
|
@ -657,6 +657,20 @@ public void testCheckoutUncachedChanges() throws IOException {
|
||||||
assertTrue(new File(trash, "foo").isFile());
|
assertTrue(new File(trash, "foo").isFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testDontOverwriteDirtyFile() throws IOException {
|
||||||
|
setupCase(mk("foo"), mk("other"), mk("foo"));
|
||||||
|
writeTrashFile("foo", "different");
|
||||||
|
try {
|
||||||
|
checkout();
|
||||||
|
fail("Didn't got the expected conflict");
|
||||||
|
} catch (CheckoutConflictException e) {
|
||||||
|
assertIndex(mk("foo"));
|
||||||
|
assertWorkDir(mkmap("foo", "different"));
|
||||||
|
assertTrue(getConflicts().equals(Arrays.asList("foo")));
|
||||||
|
assertTrue(new File(trash, "foo").isFile());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The interface these tests need from a class implementing a checkout
|
* The interface these tests need from a class implementing a checkout
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue