|
|
|
@ -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)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|