project search: Do not bail on search when a binary file is encountered (#23775)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
7105f9c68c
commit
b74a273934
1 changed files with 3 additions and 2 deletions
|
@ -1026,9 +1026,10 @@ impl WorktreeStore {
|
||||||
{
|
{
|
||||||
// Before attempting to match the file content, throw away files that have invalid UTF-8 sequences early on;
|
// Before attempting to match the file content, throw away files that have invalid UTF-8 sequences early on;
|
||||||
// That way we can still match files in a streaming fashion without having look at "obviously binary" files.
|
// That way we can still match files in a streaming fashion without having look at "obviously binary" files.
|
||||||
return Err(anyhow!(
|
log::debug!(
|
||||||
"Invalid UTF-8 sequence in file {abs_path:?} at byte position {starting_position}"
|
"Invalid UTF-8 sequence in file {abs_path:?} at byte position {starting_position}"
|
||||||
));
|
);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if query.detect(file).unwrap_or(false) {
|
if query.detect(file).unwrap_or(false) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue