From b74a2739347a76eed2da9af645ae372917c822ce Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:54:00 +0100 Subject: [PATCH] project search: Do not bail on search when a binary file is encountered (#23775) Closes #ISSUE Release Notes: - N/A --- crates/project/src/worktree_store.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/project/src/worktree_store.rs b/crates/project/src/worktree_store.rs index 01bd67d6fb..49f6c9070d 100644 --- a/crates/project/src/worktree_store.rs +++ b/crates/project/src/worktree_store.rs @@ -1026,9 +1026,10 @@ impl WorktreeStore { { // 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. - return Err(anyhow!( + log::debug!( "Invalid UTF-8 sequence in file {abs_path:?} at byte position {starting_position}" - )); + ); + continue; } if query.detect(file).unwrap_or(false) {