From 9cf980a3c3b65f24f6306c87e138ea686c17ef46 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 7 Dec 2025 23:11:09 +0100 Subject: [PATCH] Skip auto-commit if rewrite/rebase is in progress for the folder --- main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index cab6dfd..c5d6f42 100755 --- a/main.js +++ b/main.js @@ -1364,7 +1364,16 @@ async function autoCommit(folderPath, message, win) { const git = simpleGit(folderPath); - // If a previous rebase (likely from commit rewrite) is still open, abort it so auto-commit can proceed. + // Skip auto-commit if a rewrite/rebase is in progress for this folder + const foldersState = store.get('folders') || []; + const idxState = foldersState.findIndex(f => f.path === folderPath); + const rewriteActive = idxState !== -1 ? !!foldersState[idxState].rewriteInProgress : false; + if (rewriteActive) { + debug(`[autoCommit] Rewrite in progress for ${folderPath}, skipping auto-commit.`); + return false; + } + + // If a previous rebase (not from our rewrite) is still open, abort it so auto-commit can proceed. if (isRebaseInProgress(folderPath)) { try { debug(`[autoCommit] Rebase detected in ${folderPath}, aborting to unblock auto-commit.`);