Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughExtends discard mutations to detect and remove untracked and staged-new files: adds Git-status parsing helpers and secure file deletion in backend mutations, and updates UI dialog text to reflect deletion behavior. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as ChangesView (UI)
participant Router as staging.ts (TRPC)
participant Git as Git Utilities (simple-git)
participant FS as File System (secureFs)
User->>UI: Click "Discard All Unstaged" or "Discard All Staged"
UI->>Router: discardAllUnstaged()/discardAllStaged()
Router->>Git: parseGitStatus() -> get list of target files
Git-->>Router: [untracked / staged-new file paths]
Router->>Router: perform git discard/un-stage operations
Router->>FS: deleteFiles([target paths])
FS-->>Router: deletion results
Router-->>UI: success/failure
UI-->>User: show result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Previously, "Discard All" only reverted modifications to tracked files and left untracked files untouched (standard git behavior). This extends the functionality to also delete untracked files, providing a cleaner "discard everything" experience. Changes: - discardAllUnstaged now deletes untracked files after reverting tracked - discardAllStaged now deletes staged new files after unstaging - Updated dialog text to reflect the new behavior
6564a4f to
aaaba7c
Compare
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Previously, "Discard All" only ran
git checkout -- .which left untracked files untouched. This extends the functionality to provide a cleaner "discard everything" experience.Test plan
Summary by CodeRabbit
Bug Fixes
Documentation