1
0

Add check for relocation or non-existent folder before performing diff

This commit is contained in:
2025-05-25 05:19:54 +02:00
parent 9ab8a66cb9
commit 3859516fe6

View File

@@ -856,6 +856,9 @@ app.whenReady().then(() => {
});
// Diff
ipcMain.handle('diff-commit', async (_e, folderObj, hash) => {
if (folderObj.needsRelocation || !fs.existsSync(folderObj.path)) {
return;
}
const git = simpleGit(folderObj.path);
return git.diff([`${hash}^!`]);
});