1
0

Add check for relocation and existence before checkout

This commit is contained in:
2025-05-25 05:20:31 +02:00
parent 95d359a903
commit 4c1f4f347e

View File

@@ -876,6 +876,9 @@ app.whenReady().then(() => {
* Checkt das Arbeitsverzeichnis auf exakt den Zustand von `hash` aus.
*/
ipcMain.handle('checkout-commit', async (_e, folderObj, hash) => {
if (folderObj.needsRelocation || !fs.existsSync(folderObj.path)) {
return false;
}
const git = simpleGit(folderObj.path);
// clean mode: alle lokalen Veränderungen verwerfen
await git.checkout([hash, '--force']);