mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Check for protected files in single apply diff (#5348)
This commit is contained in:
parent
3993406ebd
commit
1be6fce1a6
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue