mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 04:44:59 +00:00
Implemented checks to ensure files with uncommitted changes or not present in previous commit cannot be undone safely.
This commit is contained in:
parent
e7f29c2dbc
commit
3ce3799f8d
2 changed files with 22 additions and 12 deletions
|
@ -585,11 +585,12 @@ class TestCommands(TestCase):
|
|||
last_commit_hash = repo.head.commit.hexsha[:7]
|
||||
coder.aider_commit_hashes.add(last_commit_hash)
|
||||
|
||||
# Attempt to undo the last commit
|
||||
# Attempt to undo the last commit, should refuse
|
||||
commands.cmd_undo("")
|
||||
|
||||
# Check that the last commit was undone
|
||||
self.assertNotEqual(last_commit_hash, repo.head.commit.hexsha[:7])
|
||||
# Check that the last commit was not undone
|
||||
self.assertEqual(last_commit_hash, repo.head.commit.hexsha[:7])
|
||||
self.assertTrue(file_path.exists())
|
||||
|
||||
del coder
|
||||
del commands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue