Compare commits

..

2 commits

Author SHA1 Message Date
Antoine Cotten
13783625fa
Merge 21358322e0 into ff7abcd0c3 2025-08-26 21:19:51 +02:00
Antoine Cotten
21358322e0
fix: sparse-checkout not disabled on subsequent checkout
If actions/checkout is invoked once with 'sparse-checkout' and cone mode
disabled, core.sparseCheckout remains enabled for all subsequent
invocations of actions/checkout.
2025-08-26 21:19:43 +02:00
2 changed files with 3 additions and 3 deletions

2
dist/index.js vendored
View file

@ -590,7 +590,7 @@ class GitCommandManager {
yield this.execGit(['sparse-checkout', 'disable']);
// Ensures that a previously enabled 'sparse-checkout' (e.g. via sparseCheckoutNonConeMode) is also disabled in the config.
yield this.execGit(['config', 'core.sparseCheckout', 'false']);
// Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
// Disabling 'sparse-checkout' leaves behind an undesirable side-effect in config (even in a pristine environment).
yield this.tryConfigUnset('extensions.worktreeConfig', false);
});
}

View file

@ -179,8 +179,8 @@ class GitCommandManager {
async disableSparseCheckout(): Promise<void> {
await this.execGit(['sparse-checkout', 'disable'])
// Ensures that a previously enabled 'sparse-checkout' (e.g. via sparseCheckoutNonConeMode) is also disabled in the config.
yield this.execGit(['config', 'core.sparseCheckout', 'false']);
// Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
await this.execGit(['config', 'core.sparseCheckout', 'false'])
// Disabling 'sparse-checkout' leaves behind an undesirable side-effect in config (even in a pristine environment).
await this.tryConfigUnset('extensions.worktreeConfig', false)
}