|
|
@ -61,8 +61,7 @@ public class StatusCommandTest extends RepositoryTestCase { |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testEmptyStatus() throws NoWorkTreeException, |
|
|
|
public void testEmptyStatus() throws NoWorkTreeException, |
|
|
|
GitAPIException { |
|
|
|
GitAPIException { |
|
|
|
Git git = new Git(db); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
|
|
|
|
|
|
|
|
Status stat = git.status().call(); |
|
|
|
Status stat = git.status().call(); |
|
|
|
assertEquals(0, stat.getAdded().size()); |
|
|
|
assertEquals(0, stat.getAdded().size()); |
|
|
|
assertEquals(0, stat.getChanged().size()); |
|
|
|
assertEquals(0, stat.getChanged().size()); |
|
|
@ -71,11 +70,12 @@ public class StatusCommandTest extends RepositoryTestCase { |
|
|
|
assertEquals(0, stat.getRemoved().size()); |
|
|
|
assertEquals(0, stat.getRemoved().size()); |
|
|
|
assertEquals(0, stat.getUntracked().size()); |
|
|
|
assertEquals(0, stat.getUntracked().size()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testDifferentStates() throws IOException, |
|
|
|
public void testDifferentStates() throws IOException, |
|
|
|
NoFilepatternException, GitAPIException { |
|
|
|
NoFilepatternException, GitAPIException { |
|
|
|
Git git = new Git(db); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
writeTrashFile("a", "content of a"); |
|
|
|
writeTrashFile("a", "content of a"); |
|
|
|
writeTrashFile("b", "content of b"); |
|
|
|
writeTrashFile("b", "content of b"); |
|
|
|
writeTrashFile("c", "content of c"); |
|
|
|
writeTrashFile("c", "content of c"); |
|
|
@ -130,11 +130,12 @@ public class StatusCommandTest extends RepositoryTestCase { |
|
|
|
assertEquals(1, stat.getUntrackedFolders().size()); |
|
|
|
assertEquals(1, stat.getUntrackedFolders().size()); |
|
|
|
assertTrue(stat.getUntrackedFolders().contains("sub")); |
|
|
|
assertTrue(stat.getUntrackedFolders().contains("sub")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testDifferentStatesWithPaths() throws IOException, |
|
|
|
public void testDifferentStatesWithPaths() throws IOException, |
|
|
|
NoFilepatternException, GitAPIException { |
|
|
|
NoFilepatternException, GitAPIException { |
|
|
|
Git git = new Git(db); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
writeTrashFile("a", "content of a"); |
|
|
|
writeTrashFile("a", "content of a"); |
|
|
|
writeTrashFile("D/b", "content of b"); |
|
|
|
writeTrashFile("D/b", "content of b"); |
|
|
|
writeTrashFile("D/c", "content of c"); |
|
|
|
writeTrashFile("D/c", "content of c"); |
|
|
@ -167,3 +168,4 @@ public class StatusCommandTest extends RepositoryTestCase { |
|
|
|
assertEquals(Sets.of("a", "D/b", "D/D/d"), stat.getModified()); |
|
|
|
assertEquals(Sets.of("a", "D/b", "D/D/d"), stat.getModified()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|