mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
Added helpful suggestions to /undo and /diff errors
This commit is contained in:
parent
2e6c785c3b
commit
82dc995a04
1 changed files with 5 additions and 0 deletions
|
@ -210,6 +210,10 @@ class Commands:
|
|||
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.")
|
||||
self.io.tool_error(
|
||||
"You could try `/git reset --hard HEAD^` but be aware that this is a destructive"
|
||||
" command!"
|
||||
)
|
||||
return
|
||||
self.coder.repo.repo.git.reset("--hard", "HEAD~1")
|
||||
self.io.tool_output(
|
||||
|
@ -229,6 +233,7 @@ class Commands:
|
|||
|
||||
if not self.coder.last_aider_commit_hash:
|
||||
self.io.tool_error("No previous aider commit found.")
|
||||
self.io.tool_error("You could try `/git diff` or `/git diff HEAD^`.")
|
||||
return
|
||||
|
||||
commits = f"{self.coder.last_aider_commit_hash}~1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue