aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2010-08-30 09:07:59 +0200
committerChristian Halstrick <christian.halstrick@sap.com>2010-08-30 09:34:17 +0200
commit0bdf73db7f0b5cc4650a50b3fd657bc7cf35fab6 (patch)
tree0af64e6244e9d0aa0d300d6a17a7988cf8700d14 /org.eclipse.jgit.test/tst/org/eclipse/jgit
parentbc0359c42fe74e0ea184b87913e5275ac3533f1d (diff)
downloadjgit-0bdf73db7f0b5cc4650a50b3fd657bc7cf35fab6.tar.gz
jgit-0bdf73db7f0b5cc4650a50b3fd657bc7cf35fab6.zip
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>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java
index 22430e6858..cb82389f6a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReadTreeTest.java
@@ -657,6 +657,20 @@ public abstract class ReadTreeTest extends RepositoryTestCase {
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
*/