mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
Adopt safe_abs_path
This commit is contained in:
parent
2c32fe5eb8
commit
1c1411b506
3 changed files with 3 additions and 8 deletions
|
@ -1,5 +1,3 @@
|
|||
import os
|
||||
|
||||
from aider import diffs
|
||||
|
||||
from ..dump import dump # noqa: F401
|
||||
|
@ -88,7 +86,7 @@ class SingleWholeFileFunctionCoder(Coder):
|
|||
lines = content.splitlines(keepends=True)
|
||||
|
||||
# ending an existing block
|
||||
full_path = os.path.abspath(os.path.join(self.root, fname))
|
||||
full_path = self.abs_root_path(fname)
|
||||
|
||||
content = self.io.read_text(full_path)
|
||||
if content is None:
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import os
|
||||
|
||||
from aider import diffs
|
||||
|
||||
from ..dump import dump # noqa: F401
|
||||
|
@ -99,7 +97,7 @@ class WholeFileFunctionCoder(Coder):
|
|||
lines = content.splitlines(keepends=True)
|
||||
|
||||
# ending an existing block
|
||||
full_path = os.path.abspath(os.path.join(self.root, fname))
|
||||
full_path = self.abs_root_path(fname)
|
||||
|
||||
content = self.io.read_text(full_path)
|
||||
if content is None:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -350,7 +349,7 @@ class Commands:
|
|||
other_files = []
|
||||
chat_files = []
|
||||
for file in files:
|
||||
abs_file_path = os.path.abspath(os.path.join(self.coder.root, file))
|
||||
abs_file_path = self.coder.abs_root_path(file)
|
||||
if abs_file_path in self.coder.abs_fnames:
|
||||
chat_files.append(file)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue