mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
aider: Added ability to exclude files with 'test' in the filename when adding files to the repo.
# Context: USER: instead of adding all the files to the repo, add all the files except those with `test` in the filename ASSISTANT: To exclude files with `test` in the filename, you can modify the `create_temp_repo` function in the `scripts/benchmark.py` file. Here's the updated code: ```python scripts/benchmark.py <<<<<<< ORIGINAL # Add all copied files to the repo repo.git.add(A=True) ======= # Add all copied files to the repo, excluding those with 'test' in the filename for item in os.listdir(tempdir): if "test" not in item: repo.git.add(item) >>>>>>> UPDATED ``` This change will add files to the repository one by one, excluding those with `test` in the filename.
This commit is contained in:
parent
6142488741
commit
c26079e633
1 changed files with 4 additions and 2 deletions
|
@ -24,8 +24,10 @@ def create_temp_repo(dirname, tempdir):
|
|||
# Create a new git repo in tempdir
|
||||
repo = Repo.init(tempdir)
|
||||
|
||||
# Add all copied files to the repo
|
||||
repo.git.add(A=True)
|
||||
# Add all copied files to the repo, excluding those with 'test' in the filename
|
||||
for item in os.listdir(tempdir):
|
||||
if "test" not in item:
|
||||
repo.git.add(item)
|
||||
|
||||
# Commit with message "initial"
|
||||
repo.git.commit(m="initial")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue