diff --git a/src/cli/update-cli.test.ts b/src/cli/update-cli.test.ts index b2a02498763..1e48dc76109 100644 --- a/src/cli/update-cli.test.ts +++ b/src/cli/update-cli.test.ts @@ -1043,15 +1043,7 @@ describe("update-cli", () => { .mock.calls.map((call) => String(call[0])) .join("\n"), ).toContain( - "Skipped plugin update sync in the pre-update CLI process after switching to a git install.", - ); - expect( - vi - .mocked(defaultRuntime.log) - .mock.calls.map((call) => String(call[0])) - .join("\n"), - ).toContain( - "Skipped completion/restart follow-ups in the pre-update CLI process after switching to a git install.", + "Switched from a package install to a git checkout. Skipping remaining post-update work in the old CLI process; rerun follow-up commands from the new git install if needed.", ); }); it("explains why git updates cannot run with edited files", async () => { diff --git a/src/cli/update-cli/update-command.ts b/src/cli/update-cli/update-command.ts index 77024e657fd..8770b96ef5d 100644 --- a/src/cli/update-cli/update-command.ts +++ b/src/cli/update-cli/update-command.ts @@ -1038,6 +1038,17 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise { return; } + if (switchToGit && result.status === "ok" && result.mode === "git") { + if (!opts.json) { + defaultRuntime.log( + theme.muted( + "Switched from a package install to a git checkout. Skipping remaining post-update work in the old CLI process; rerun follow-up commands from the new git install if needed.", + ), + ); + } + return; + } + let postUpdateConfigSnapshot = configSnapshot; if (requestedChannel && configSnapshot.valid && requestedChannel !== storedChannel) { if (switchToGit) {