fix(cli): skip deleted files in --changed and --staged#8445
fix(cli): skip deleted files in --changed and --staged#8445dyc3 merged 1 commit intobiomejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 207af04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded@tt-a1i has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 32 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
✨ 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 |
f9ee441 to
207af04
Compare
Summary
Fix
--changedand--stagedflags throwing "No such file or directory" error when a file has been deleted or renamed in the working directory but the change hasn't been committed yet.The issue occurs because:
git diff --name-only base...HEADreturns files that exist in HEADSolution
Filter out files that no longer exist in the working directory before processing them. This is done in
get_changed_filesandget_staged_filesfunctions usingfs.path_exists().Test plan
Manual testing:
git checkout mainecho "const a=1" > test.tsgit add test.ts && git commit -m "add test.ts"git checkout -b testecho "const a=2" > test.tsgit add test.ts && git commit -m "modify test.ts"mv test.ts test2.tsbiome check --changed- should no longer throw errorCloses #4952