Finished removing reliance on aider:

This commit is contained in:
Paul Gauthier 2024-06-18 10:05:10 -07:00
parent 5a3627de6e
commit 39f10aefe0
2 changed files with 7 additions and 3 deletions

View file

@ -332,7 +332,7 @@ class Commands:
last_commit = self.coder.repo.repo.head.commit
if (
not last_commit.message.startswith("aider:")
"(aider)" not in last_commit.committer.name
or last_commit.hexsha[:7] != self.coder.last_aider_commit_hash
):
self.io.tool_error("The last commit was not made by aider in this chat session.")

View file

@ -523,16 +523,20 @@ class TestCommands(TestCase):
other_path.write_text("other content")
repo.git.add(str(other_path))
os.environ["GIT_COMMITTER_NAME"] = "Foo (aider)"
# Create and commit a file
filename = "test_file.txt"
file_path = Path(repo_dir) / filename
file_path.write_text("first content")
repo.git.add(filename)
repo.git.commit("-m", "aider: first commit")
repo.git.commit("-m", "first commit")
file_path.write_text("second content")
repo.git.add(filename)
repo.git.commit("-m", "aider: second commit")
repo.git.commit("-m", "second commit")
del os.environ["GIT_COMMITTER_NAME"]
# Store the commit hash
last_commit_hash = repo.head.commit.hexsha[:7]