Create recursive symlink rather than storing it in version control. Summary: The presence of this recursive symlink was causing `ant lint` to yield a warning, which is distracting. Test Plan: Sandcastle builds.
diff --git a/test/com/facebook/buck/testutil/integration/ProjectWorkspace.java b/test/com/facebook/buck/testutil/integration/ProjectWorkspace.java index 822fc1f..b65e29b 100644 --- a/test/com/facebook/buck/testutil/integration/ProjectWorkspace.java +++ b/test/com/facebook/buck/testutil/integration/ProjectWorkspace.java
@@ -164,6 +164,13 @@ return Files.toString(getFile(pathRelativeToProjectRoot), Charsets.UTF_8); } + /** + * @return the specified path resolved against the root of this workspace. + */ + public Path resolve(Path pathRelativeToWorkspaceRoot) { + return destPath.resolve(pathRelativeToWorkspaceRoot); + } + /** The result of running {@code buck} from the command line. */ public static class ProcessResult { private final int exitCode;
diff --git a/test/com/facebook/buck/util/DirectoryTraversalTest.java b/test/com/facebook/buck/util/DirectoryTraversalTest.java index fb205e6..8556378 100644 --- a/test/com/facebook/buck/util/DirectoryTraversalTest.java +++ b/test/com/facebook/buck/util/DirectoryTraversalTest.java
@@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Files; public class DirectoryTraversalTest { @Rule @@ -39,6 +40,13 @@ this, "directory_traversal_ignore_paths", temporaryFolder); workspace.setUp(); + // Write a recursive symlink. We could store this in version control, but `ant lint` emits a + // warning about the recursive symlink. + Files.createDirectories(workspace.resolve(java.nio.file.Paths.get("loop/1"))); + Files.createSymbolicLink( + workspace.resolve(java.nio.file.Paths.get("loop/1/upwards")), + java.nio.file.Paths.get("../")); + // The workspace contains the following: // // | path