fix: prevent sparse checkout config from leaking to main repo (GH#886)

Use git sparse-checkout command instead of manually setting
core.sparseCheckout config. The sparse-checkout command properly
scopes the setting to the worktree via extensions.worktreeConfig,
avoiding the confusing sparse checkout message in git status.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/fang
2026-01-04 13:52:14 -08:00
committed by Steve Yegge
parent b789b99537
commit fbc93e3de2
2 changed files with 22 additions and 55 deletions

View File

@@ -547,8 +547,9 @@ func TestVerifySparseCheckoutErrors(t *testing.T) {
if err == nil {
t.Error("verifySparseCheckout should fail with invalid .git file format")
}
if !strings.Contains(err.Error(), "invalid .git file format") {
t.Errorf("Expected 'invalid .git file format' error, got: %v", err)
// git sparse-checkout list will fail when .git file is invalid
if !strings.Contains(err.Error(), "failed to list sparse checkout patterns") {
t.Errorf("Expected 'failed to list sparse checkout patterns' error, got: %v", err)
}
})
}