Skip to content

Disable extensions.worktreeConfig when disabling sparse-checkout #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Implement the fix
  • Loading branch information
jww3 committed Apr 23, 2024
commit 92b9ac51a1e5310f81f90796291e2a6fe6c18d61
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ class GitCommandManager {
disableSparseCheckout() {
return __awaiter(this, void 0, void 0, function* () {
yield this.execGit(['sparse-checkout', 'disable']);
// Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
yield this.tryConfigUnset('extensions.worktreeConfig', false);
});
}
sparseCheckout(sparseCheckout) {
Expand Down
2 changes: 2 additions & 0 deletions src/git-command-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ class GitCommandManager {

async disableSparseCheckout(): Promise<void> {
await this.execGit(['sparse-checkout', 'disable'])
// Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
await this.tryConfigUnset('extensions.worktreeConfig', false)
}

async sparseCheckout(sparseCheckout: string[]): Promise<void> {
Expand Down
Loading