fix: pass filePath in setupRerereAdapter stale MERGE_HEAD cleanup

cleanupMergeState() without a filePath runs bare `git reset`, which
resets the entire index and can stage deletions of unrelated files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gavriel Cohen
2026-02-20 15:13:52 +02:00
parent 7181c49ada
commit 41e54a9460

View File

@@ -58,7 +58,7 @@ export function setupRerereAdapter(
// Clean up stale MERGE_HEAD from a previous crash
if (fs.existsSync(path.join(gitDir, 'MERGE_HEAD'))) {
cleanupMergeState();
cleanupMergeState(filePath);
}
// Hash objects into git object store