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:
Paul Gauthier 2023-06-23 14:01:55 -07:00
parent 6142488741
commit c26079e633

View file

@ -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")