Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/core/tools/applyDiffTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ export async function applyDiffToolLegacy(
await cline.diffViewProvider.update(diffResult.content, true)
await cline.diffViewProvider.scrollToFirstDiff()

// Check if file is write-protected
const isWriteProtected = cline.rooProtectedController?.isWriteProtected(relPath) || false

const completeMessage = JSON.stringify({
...sharedMessageProps,
diff: diffContent,
isProtected: isWriteProtected,
} satisfies ClineSayTool)

let toolProgressStatus
Expand All @@ -158,7 +162,7 @@ export async function applyDiffToolLegacy(
toolProgressStatus = cline.diffStrategy.getProgressStatus(block, diffResult)
}

const didApprove = await askApproval("tool", completeMessage, toolProgressStatus)
const didApprove = await askApproval("tool", completeMessage, toolProgressStatus, isWriteProtected)

if (!didApprove) {
await cline.diffViewProvider.revertChanges() // Cline likely handles closing the diff view
Expand Down
Loading