Remove force from git checkout & unselect version if checkout fails (#248)

#247
This commit is contained in:
Will Chen
2025-05-26 11:35:36 -07:00
committed by GitHub
parent dbe95dafc4
commit 2bb8902b08
2 changed files with 6 additions and 2 deletions

View File

@@ -72,7 +72,12 @@ export function VersionPane({ isVisible, onClose }: VersionPaneProps) {
const handleVersionClick = async (versionOid: string) => { const handleVersionClick = async (versionOid: string) => {
if (appId) { if (appId) {
setSelectedVersionId(versionOid); 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);
}
} }
}; };

View File

@@ -225,7 +225,6 @@ export function registerVersionHandlers() {
fs, fs,
dir: appPath, dir: appPath,
ref: versionId, ref: versionId,
force: true,
}); });
}); });
}, },