mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
aider: Added an elif
clause for which == "chat_files"
and a final else
clause to raise a ValueError
if the value of which
is not valid.
# Context: USER: nice! in the change the else: to elseif which==chat_files and throw a valueerror as a final else clause ASSISTANT: To update the `commit()` function with the requested changes, we will modify the `if` statement to include an `elif` clause for `which == "chat_files"` and add a final `else` clause to raise a `ValueError`. ```python aider/coder.py <<<<<<< ORIGINAL if which == "repo_files": all_files = [os.path.join(self.root, f) for f in self.get_all_relative_files()] dirty_fnames, relative_dirty_fnames = get_dirty_files(all_files) else: dirty_fnames, relative_dirty_fnames = get_dirty_files(self.abs_fnames) ======= if which == "repo_files": all_files = [os.path.join(self.root, f) for f in self.get_all_relative_files()] dirty_fnames, relative_dirty_fnames = get_dirty_files(all_files) elif which == "chat_files": dirty_fnames, relative_dirty_fnames = get_dirty_files(self.abs_fnames) else: raise ValueError(f"Invalid value for 'which': {which}") >>>>>>> UPDATED ``` This change adds an `elif` clause for `which == "chat_files"` and a final `else` clause to raise a `ValueError` if the value of `which` is not valid.
This commit is contained in:
parent
da40aaa6ca
commit
cee1dfd3b9
1 changed files with 3 additions and 1 deletions
|
@ -438,8 +438,10 @@ class Coder:
|
|||
if which == "repo_files":
|
||||
all_files = [os.path.join(self.root, f) for f in self.get_all_relative_files()]
|
||||
dirty_fnames, relative_dirty_fnames = get_dirty_files(all_files)
|
||||
else:
|
||||
elif which == "chat_files":
|
||||
dirty_fnames, relative_dirty_fnames = get_dirty_files(self.abs_fnames)
|
||||
else:
|
||||
raise ValueError(f"Invalid value for 'which': {which}")
|
||||
repo = self.repo
|
||||
if not repo:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue