Repository navigation
Fix: /undo destructively interacts with git staging (#8214) - #8303
Merged
etraut-openai merged 2 commits intoDec 19, 2025
Merged
Conversation
Contributor
|
@Galaxy-0, thanks for the contribution. Could you please fix the linter (cargo clippy) errors? |
Galaxy-0
force-pushed
the
fix/issue-8214-undo-git-staging
branch
from
December 19, 2025 06:31
dbd4343 to
ac79d3a
Compare
Previously, /undo would run git restore --staged, which wiped out any changes the user had staged since the last formatting. This change removes the --staged flag, ensuring that strictly the working tree is reverted to the snapshot state, while preserving the user's index (staged changes). Added regression test.
Galaxy-0
force-pushed
the
fix/issue-8214-undo-git-staging
branch
from
December 19, 2025 07:07
ac79d3a to
d54b01d
Compare
Contributor
Author
|
Fixed clippy lints and rebased on latest main. Ready for review! |
Contributor
|
@codex review |
jif-oai
approved these changes
Dec 19, 2025
jif-oai
left a comment
Contributor
There was a problem hiding this comment.
Ok for me if Codex does not raise any nits
Contributor
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8214 by removing the '--staged' flag from the undo git restore command. This ensures that while the working tree is reverted to the snapshot state, the user's staged changes (index) are preserved, preventing data loss. Also adds a regression test.