mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
27e60d0c17
In --git mode, untracked files (git ls-files --others) were read straight to memory with only a binary check — unlike directory and single-file modes, which also apply --include/--exclude globs and the 1 MiB MAX_FILE_BYTES cap. So `pxpipe export --git --include '*.ts'` still slurped every untracked file regardless of the filter, and an untracked multi-MB file was read whole (a resource-safety hazard). - extract the shared gate into src/export-collect.ts: readExportTextFile() applies include/exclude → size → binary, in that order, and is import-safe (src/core/export.ts is contractually fs-free, so it can't live there) - route all three collection paths (walkDir, single-file target, --git untracked) through it; untracked skips now warn like explicit targets do - tests/export-collect.test.ts covers include, exclude, oversized, the size boundary, binary, and inaccessible Verified end-to-end: `export --git --include '*.ts'` in a temp repo excludes an untracked .md, skips an oversized .ts (with a warning), and keeps the .ts.