mirror of https://github.com/sbt/sbt.git
**Problem** When a scripted test creates a symbolic link within the test directory pointing to a file or directory outside of it, the batch cleanup code follows the symlink and deletes the external target. This is because `view.list(base / **, !keep)` recursively traverses symlinked directories, and the resulting paths resolve to the external location. **Solution** Replace the flat recursive glob listing with manual recursion that checks `FileAttributes.isSymbolicLink` before descending into directories, matching the pattern already used in `Clean.scala`. Symlinks are now deleted as leaf nodes without traversing their targets. Also hoists the cleanup helpers out of the per-test loop since they only depend on the (constant) temp directory. Fixes sbt/sbt#7331 |
||
|---|---|---|
| .. | ||
| src/main/scala/sbt/scriptedtest | ||
| NOTICE | ||