Files
bun.sh/test/cli
Claude Bot ae6437ecfc Add git sparse checkout support for subdirectories
Implements pnpm-compatible path: syntax for installing from git repository subdirectories.
This enables efficient monorepo support by only downloading the required subdirectory
using Git 2.25+ sparse checkout features.

Syntax:
- github:user/repo#path:/packages/foo
- user/repo#branch&path:/packages/bar
- git+https://github.com/user/repo.git#commit&path:subdir

Features:
- Modern sparse checkout with cone mode for O(1) performance
- Subdirectory path normalized once during parsing (no leading slash)
- Uses stack buffers (PathBuffer) to avoid allocations in hot path
- Atomic directory restructuring with proper error handling
- Cache isolation with subdirectory hash
- Works with both regular and isolated installs
- Comprehensive tests with .d.ts file verification

Implementation details:
- Added subdirectory field to Repository struct
- Normalize subdirectory path during dependency parsing (strip leading /)
- Tag.infer checks for path: parameter early to route to git (not GitHub API)
- Sparse checkout restructures directory atomically using temp location
- Tests verify actual package files, no flaky timing-based checks

Files modified:
- src/install/repository.zig - Core sparse checkout + atomic restructuring
- src/install/dependency.zig - Parsing with normalization + Tag.infer fixes
- src/install/PackageManager/PackageManagerDirectories.zig - Cache naming
- src/install/PackageManagerTask.zig - Task handling
- src/install/PackageManager/PackageManagerEnqueue.zig - Task queueing
- src/install/PackageManager/runTasks.zig - Task execution
- test/cli/install/git-sparse-checkout.test.ts - Comprehensive tests (new)

Tests: 6 passing, 42 expect() calls, 7.89s

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 11:10:07 +00:00
..
2025-05-24 13:36:51 -07:00
2025-10-11 08:23:25 -07:00
2025-11-01 20:17:56 -07:00