mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 21:04:59 +00:00
fix: Add support for directories with special characters in cmd_add
This commit is contained in:
parent
7b2379c7c2
commit
65d224fba4
2 changed files with 24 additions and 0 deletions
|
@ -31,6 +31,7 @@ ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
|||
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
|
||||
|
||||
Just suggest shell commands this way, not example code.
|
||||
Only suggest complete shell commands that area ready to execute, without placeholders.
|
||||
|
||||
Use the appropriate shell based on the user's system info:
|
||||
{platform}
|
||||
|
|
|
@ -452,6 +452,29 @@ class TestCommands(TestCase):
|
|||
|
||||
commands.cmd_add(str(dname))
|
||||
|
||||
dump(coder.abs_fnames)
|
||||
self.assertIn(str(fname.resolve()), coder.abs_fnames)
|
||||
|
||||
def test_cmd_add_dirname_with_special_chars_git(self):
|
||||
with GitTemporaryDirectory():
|
||||
io = InputOutput(pretty=False, yes=False)
|
||||
from aider.coders import Coder
|
||||
|
||||
coder = Coder.create(self.GPT35, None, io)
|
||||
commands = Commands(io, coder)
|
||||
|
||||
dname = Path("with[brackets]")
|
||||
dname.mkdir()
|
||||
fname = dname / "filename.txt"
|
||||
fname.touch()
|
||||
|
||||
repo = git.Repo()
|
||||
repo.git.add(str(fname))
|
||||
repo.git.commit("-m", "init")
|
||||
|
||||
commands.cmd_add(str(dname))
|
||||
|
||||
dump(coder.abs_fnames)
|
||||
self.assertIn(str(fname.resolve()), coder.abs_fnames)
|
||||
|
||||
def test_cmd_add_abs_filename(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue