Enable ant default excludes to be turned off.

Add a new overload method to list files that include the files that ant excludes by default.
This commit is contained in:
bap2000 authored and Kohsuke Kawaguchi committed 2012-05-14 16:01:42 -07:00
1 parent 6fd4514663
commit 9d8f300179
2 files changed
+35 -3

No files matched your search

+17 -1
View File
@@ -301,7 +301,23 @@ public class FilePathTest extends ChannelTestCase {
Util.deleteRecursive(baseDir);
}
}
public void testListWithDefaultExcludes() throws Exception {
File baseDir = Util.createTempDir();
try {
final Set<FilePath> expected = new HashSet<FilePath>();
expected.add(createFilePath(baseDir, "top", "sub", "backup~"));
expected.add(createFilePath(baseDir, "top", "CVS", "somefile,v"));
expected.add(createFilePath(baseDir, "top", ".git", "config"));
// none of the files are included by default (default includes true)
assertEquals(0, new FilePath(baseDir).list("**", "").length);
final FilePath[] result = new FilePath(baseDir).list("**", "", false);
assertEquals(expected, new HashSet<FilePath>(Arrays.asList(result)));
} finally {
Util.deleteRecursive(baseDir);
}
}
@Bug(11073)
public void testIsUnix() {
FilePath winPath = new FilePath(new LocalChannel(null),