mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-18 02:25:00 +00:00
Properly test if /added file is already in the repo #314
This commit is contained in:
parent
2609ec1b06
commit
d720bfe459
2 changed files with 28 additions and 1 deletions
|
@ -305,6 +305,7 @@ class Commands:
|
|||
|
||||
for matched_file in all_matched_files:
|
||||
abs_file_path = self.coder.abs_root_path(matched_file)
|
||||
rel_path = self.coder.get_rel_fname(matched_file)
|
||||
|
||||
if not abs_file_path.startswith(self.coder.root):
|
||||
self.io.tool_error(
|
||||
|
@ -312,7 +313,7 @@ class Commands:
|
|||
)
|
||||
continue
|
||||
|
||||
if self.coder.repo and matched_file not in git_files:
|
||||
if self.coder.repo and rel_path not in git_files:
|
||||
try:
|
||||
self.coder.repo.repo.git.add(abs_file_path)
|
||||
git_added.append(matched_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue