|
@@ -147,9 +147,13 @@ export async function applyDiffToolLegacy(
|
|
|
await cline.diffViewProvider.update(diffResult.content, true)
|
|
await cline.diffViewProvider.update(diffResult.content, true)
|
|
|
await cline.diffViewProvider.scrollToFirstDiff()
|
|
await cline.diffViewProvider.scrollToFirstDiff()
|
|
|
|
|
|
|
|
|
|
+ // Check if file is write-protected
|
|
|
|
|
+ const isWriteProtected = cline.rooProtectedController?.isWriteProtected(relPath) || false
|
|
|
|
|
+
|
|
|
const completeMessage = JSON.stringify({
|
|
const completeMessage = JSON.stringify({
|
|
|
...sharedMessageProps,
|
|
...sharedMessageProps,
|
|
|
diff: diffContent,
|
|
diff: diffContent,
|
|
|
|
|
+ isProtected: isWriteProtected,
|
|
|
} satisfies ClineSayTool)
|
|
} satisfies ClineSayTool)
|
|
|
|
|
|
|
|
let toolProgressStatus
|
|
let toolProgressStatus
|
|
@@ -158,7 +162,7 @@ export async function applyDiffToolLegacy(
|
|
|
toolProgressStatus = cline.diffStrategy.getProgressStatus(block, diffResult)
|
|
toolProgressStatus = cline.diffStrategy.getProgressStatus(block, diffResult)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const didApprove = await askApproval("tool", completeMessage, toolProgressStatus)
|
|
|
|
|
|
|
+ const didApprove = await askApproval("tool", completeMessage, toolProgressStatus, isWriteProtected)
|
|
|
|
|
|
|
|
if (!didApprove) {
|
|
if (!didApprove) {
|
|
|
await cline.diffViewProvider.revertChanges() // Cline likely handles closing the diff view
|
|
await cline.diffViewProvider.revertChanges() // Cline likely handles closing the diff view
|