Repository navigation
fix(rg): preserve indexed explicit binary inputs - #1955
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes rg’s indexed-search input classification so that indexed matches corresponding to an explicit file operand are treated as explicit inputs, restoring the default “explicit files are binary by default” behavior for binary files on SearchCapable filesystems.
Changes:
- In
try_indexed_search, constructRgInput::explicit(...)(instead of alwaysRgInput::discovered(...)) when an indexed match corresponds to an explicit file operand. - Add a regression test intended to cover explicit binary-file behavior when the filesystem provides indexed search results.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }], | ||
| }); | ||
|
|
||
| let result = run_rg_with_fs(&["needle", "/proj/bin.dat"], None, fs).await; |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | d3d2a02 | Commit Preview URL | Jun 05 2026, 08:24 PM |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
try_indexed_searchproducedRgInput::discoveredfor all indexed matches even when the match corresponded to an explicit file operand, so the explicit-binary behavior (explicit files treated as binary by default) was not applied for indexedSearchCapablefilesystems.Description
try_indexed_search, preserve the explicit-file classification by constructingRgInput::explicitwhenexplicit_file_matchis true instead of unconditionally usingRgInput::discovered.test_rg_indexed_explicit_binary_file_reports_match_by_defaultunder the existingIndexedTestFsscaffolding to cover an explicit binary file returned via an indexed search.crates/bashkit/src/builtins/rg/mod.rsand do not alter recursive/discovered matching semantics.Testing
cargo fmt --checkwhich succeeded.cargo test -p bashkit --lib test_rg_indexed_explicit_binary_file_reports_match_by_default -- --nocapturewhich passed.Codex Task