From 6837c8aa6bc314cd02e44f71e9377f3eada7120f Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:20:24 -0400 Subject: [PATCH] git_graph: Fix empty search case (#52845) This fixes a bug where search would match all commits if there was an empty query instead of setting the query to None Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A or Added/Fixed/Improved ... --------- Co-authored-by: Remco Smits --- crates/git_graph/src/git_graph.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs index b971566075181350453b28bf9909371e51436021..d169ba686098dddd4881915ece11c8a97148affa 100644 --- a/crates/git_graph/src/git_graph.rs +++ b/crates/git_graph/src/git_graph.rs @@ -1324,6 +1324,12 @@ impl GitGraph { editor.set_text_style_refinement(Default::default()); }); + if query.as_str().is_empty() { + self.search_state.state = QueryState::Empty; + cx.notify(); + return; + } + let (request_tx, request_rx) = smol::channel::unbounded::(); repo.update(cx, |repo, cx| {