diff --git a/apps/sparo-lib/src/cli/commands/checkout.ts b/apps/sparo-lib/src/cli/commands/checkout.ts index 052b1af..d542b6e 100644 --- a/apps/sparo-lib/src/cli/commands/checkout.ts +++ b/apps/sparo-lib/src/cli/commands/checkout.ts @@ -204,11 +204,14 @@ export class CheckoutCommand implements ICommand { throw new Error(`git checkout failed`); } - // sync local sparse checkout state with given profiles. - await this._sparoProfileService.syncProfileState({ - profiles: isNoProfile ? undefined : profiles, - addProfiles - }); + // No need to sync sparse checkout state if the target kind is file path + if (checkoutTargetKind !== 'filePath') { + // Sync local sparse checkout state with given profiles. + await this._sparoProfileService.syncProfileState({ + profiles: isNoProfile ? undefined : profiles, + addProfiles + }); + } }; public getHelp(): string { diff --git a/common/changes/sparo/fix-checkout-filepath_2024-03-29-21-20.json b/common/changes/sparo/fix-checkout-filepath_2024-03-29-21-20.json new file mode 100644 index 0000000..b282682 --- /dev/null +++ b/common/changes/sparo/fix-checkout-filepath_2024-03-29-21-20.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "sparo", + "comment": "No need to sync sparse checkout state if the target kind is file path", + "type": "none" + } + ], + "packageName": "sparo" +} \ No newline at end of file