Repository navigation
fix(diff): preserve staged ignored files in workspace - #1126
Parikalp-Bhardwaj wants to merge 1 commit into
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). |
|
Thanks for the fix @Parikalp-Bhardwaj — the underlying bug is still present on What changed on main: Could you please:
The test you added already covers the right cases, so it should transfer directly. |
b604823 to
ab64915
Compare
|
Thanks for the guidance @lizhengfeng101 Rebased #1126 onto the latest It now keeps force-added staged files that match Provider-directory handling and ordering are unchanged. I also updated the #1300 ordering test, since it expected a tracked ignored file to be dropped. With this fix, tracked files matching Let me know if you want this behavior limited only to force-added staged files. |
|
@lizhengfeng101 since That overlaps a bit with #1487, but I haven't marked it as fixed because that, issue also discusses whether the reviewed ref's ignore rules should be used. #1510/#1511 look complementary here — they add the separate frozen |
NanaseInori
left a comment
There was a problem hiding this comment.
Reviewed both changed files, the surrounding diff collection/untracked filtering, #1121 and the existing discussion. I also inspected #1511's actual partitionDiffs change: its ignore bypass is restricted to the new frozen staged mode, whereas this patch corrects the existing shared partitioning path. It does not supersede this fix.
Removing the second .gitignore pass keeps paths that Git already selected, while untrackedFilesList still uses --others --exclude-standard and its existing filtering. Built-in provider-directory exclusions and the Included/Excluded order bookkeeping remain intact. The updated ordering regression correctly retains the tracked ignored file, and the new workspace fixture distinguishes a force-added file from an ordinary ignored untracked sibling. I found no blocking defect in this focused change.
I independently checked that Git boundary in a temporary repository: git diff HEAD included the modified tracked file and the force-added ignored helper; ls-files --others --exclude-standard omitted the ignored generated sibling. This was a Git-selection fixture, not execution of OCR's regression suite.
Scope remains important: provider-directory exclusions still apply, including vendor, so this does not promise to admit every path mentioned in #1121. The shared change also stops the live working-tree .gitignore from hiding Git-returned commit/range diffs, as the author already disclosed. GitHub currently reports a merge conflict; resolve/rebase it and rerun the relevant tests before merging. This approval concerns the reviewed patch, not merge readiness or an independently verified full-suite result.
This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.
Summary
Fixes workspace reviews dropping staged files that match
.gitignorepatterns.Changes
.gitignorerules to diffs already collected by Git.Related #1121