Skip to content

Commit daf04d2

Browse files
committed
fix(parser): resolve add and delete file paths with rootpath
1 parent 3bbf566 commit daf04d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

codetide/mcp/tools/patch_code/parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ def parse(self) -> None:
278278

279279
# ---------- DELETE ---------- #
280280
if path := self.read_str("*** Delete File: "):
281+
if self.rootpath is not None:
282+
path = str(self.rootpath / path)
281283
if path in self.patch.actions:
282284
raise DiffError(f"Duplicate delete for file: {path}")
283285
if path not in self.current_files:
@@ -287,6 +289,8 @@ def parse(self) -> None:
287289

288290
# ---------- ADD ---------- #
289291
if path := self.read_str("*** Add File: "):
292+
if self.rootpath is not None:
293+
path = str(self.rootpath / path)
290294
if path in self.patch.actions:
291295
raise DiffError(f"Duplicate add for file: {path}")
292296
# The check for file existence is now handled in `process_patch`

0 commit comments

Comments
 (0)