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:
committed by
Steve Yegge
parent
b789b99537
commit
fbc93e3de2
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user