From 2bb8902b08754036ca0a07d5b46f01c74eaeb1c2 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Mon, 26 May 2025 11:35:36 -0700 Subject: [PATCH] Remove force from git checkout & unselect version if checkout fails (#248) #247 --- src/components/chat/VersionPane.tsx | 7 ++++++- src/ipc/handlers/version_handlers.ts | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/chat/VersionPane.tsx b/src/components/chat/VersionPane.tsx index 6a521d4..9b14b8c 100644 --- a/src/components/chat/VersionPane.tsx +++ b/src/components/chat/VersionPane.tsx @@ -72,7 +72,12 @@ export function VersionPane({ isVisible, onClose }: VersionPaneProps) { const handleVersionClick = async (versionOid: string) => { if (appId) { setSelectedVersionId(versionOid); - await checkoutVersion({ appId, versionId: versionOid }); + try { + await checkoutVersion({ appId, versionId: versionOid }); + } catch (error) { + console.error("Could not checkout version, unselecting version", error); + setSelectedVersionId(null); + } } }; diff --git a/src/ipc/handlers/version_handlers.ts b/src/ipc/handlers/version_handlers.ts index 9363d11..94c1ef9 100644 --- a/src/ipc/handlers/version_handlers.ts +++ b/src/ipc/handlers/version_handlers.ts @@ -225,7 +225,6 @@ export function registerVersionHandlers() { fs, dir: appPath, ref: versionId, - force: true, }); }); },