Commit 86901f3
perf(copy): limit find depth for simple directory patterns
When copying directories with simple basename patterns (e.g., `.serena`,
`node_modules`), `find` was scanning the entire repository tree recursively.
In repos with large directories like `node_modules` (2GB+), this caused
~11 seconds of unnecessary I/O per pattern.
Add `-maxdepth 1` for non-slash patterns since `gtr.copy.includeDirs`
entries are typically top-level directories. Patterns with slashes
(e.g., `vendor/bundle`) retain recursive behavior via `-path`.
Before: ~11s per pattern (full recursive find)
After: ~0.03s per pattern (top-level only)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 161b478 commit 86901f3
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | | - | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
0 commit comments