summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2017-01-16 03:44:57 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2017-01-16 03:45:00 -0500
commit8a46b603711145a05e5cd59010bc07c6f36dde41 (patch)
tree807cf6e51c5b653b9939880f40746a0f253d192a /org.eclipse.jgit.test/tst/org/eclipse/jgit
parent1c4b3f8c45fe2bbcc0ea6aa9ffee107312b37310 (diff)
parent46af7192a20bb9d2daf72badc3521320795d44a9 (diff)
downloadjgit-8a46b603711145a05e5cd59010bc07c6f36dde41.tar.gz
jgit-8a46b603711145a05e5cd59010bc07c6f36dde41.zip
Merge "Fix StashApplyCommand for stashes containing untracked changes."
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
index ce235a722f..862711571c 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
@@ -736,4 +736,21 @@ public class StashApplyCommandTest extends RepositoryTestCase {
}
assertEquals("working-directory", read(path));
}
+
+ @Test
+ public void untrackedAndTrackedChanges() throws Exception {
+ writeTrashFile(PATH, "changed");
+ String path = "untracked.txt";
+ writeTrashFile(path, "untracked");
+ git.stashCreate().setIncludeUntracked(true).call();
+ assertTrue(PATH + " should exist", check(PATH));
+ assertEquals(PATH + " should have been reset", "content", read(PATH));
+ assertFalse(path + " should not exist", check(path));
+ git.stashApply().setStashRef("stash@{0}").call();
+ assertTrue(PATH + " should exist", check(PATH));
+ assertEquals(PATH + " should have new content", "changed", read(PATH));
+ assertTrue(path + " should exist", check(path));
+ assertEquals(path + " should have new content", "untracked",
+ read(path));
+ }
}