mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
aider: Updated create_temp_repo function to remove tempdir prefix when adding files to the repository.
# Context: USER: stderr: 'fatal: pathspec 'tmp.benchmark/yacht.py' did not match any files' we shouldn't pass the tempdir prefix ASSISTANT: You're right, the tempdir prefix should not be passed when adding files to the repository. Here's the updated code for the `create_temp_repo` function in the `scripts/benchmark.py` file: ```python scripts/benchmark.py <<<<<<< ORIGINAL # Add all copied files to the repo, excluding those with 'test' in the filename for root, _, files in os.walk(tempdir): for file in files: if "test" not in file: repo.git.add(os.path.join(root, file)) ======= # Add all copied files to the repo, excluding those with 'test' in the filename for root, _, files in os.walk(tempdir): for file in files: if "test" not in file: repo.git.add(os.path.relpath(os.path.join(root, file), tempdir)) >>>>>>> UPDATED ``` This change will use `os.path.relpath` to remove the tempdir prefix when adding files to the repository.
This commit is contained in:
parent
3ff798aa5b
commit
acd85b2417
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ def create_temp_repo(dirname, tempdir):
|
||||||
for root, _, files in os.walk(tempdir):
|
for root, _, files in os.walk(tempdir):
|
||||||
for file in files:
|
for file in files:
|
||||||
if "test" not in file:
|
if "test" not in file:
|
||||||
repo.git.add(os.path.join(root, file))
|
repo.git.add(os.path.relpath(os.path.join(root, file), tempdir))
|
||||||
|
|
||||||
# Commit with message "initial"
|
# Commit with message "initial"
|
||||||
repo.git.commit(m="initial")
|
repo.git.commit(m="initial")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue