aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
index 760acbb57f..a660a5292b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
@@ -113,4 +113,23 @@ public class CleanCommandTest extends RepositoryTestCase {
assertTrue(!cleanedFiles.contains("File2.txt"));
}
+ @Test
+ public void testCleanWithDryRun() throws NoWorkTreeException, IOException {
+ // create status
+ StatusCommand command = git.status();
+ Status status = command.call();
+ Set<String> files = status.getUntracked();
+ assertTrue(files.size() > 0);
+
+ // run clean
+ Set<String> cleanedFiles = git.clean().setDryRun(true).call();
+
+ status = git.status().call();
+ files = status.getUntracked();
+
+ assertTrue(files.size() == 2);
+ assertTrue(cleanedFiles.contains("File2.txt"));
+ assertTrue(cleanedFiles.contains("File3.txt"));
+ }
+
}