git: Always zero panel's entry counts when clearing entries (#26924)

Keep the panel's state consistent even when we transition to having no
active repository.

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-03-17 22:54:21 -04:00 committed by GitHub
parent cd5d7e82d0
commit 88907eeb38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2237,7 +2237,14 @@ impl GitPanel {
fn update_visible_entries(&mut self, cx: &mut Context<Self>) {
self.entries.clear();
self.single_staged_entry.take();
self.single_staged_entry.take();
self.conflicted_count = 0;
self.conflicted_staged_count = 0;
self.new_count = 0;
self.tracked_count = 0;
self.new_staged_count = 0;
self.tracked_staged_count = 0;
self.entry_count = 0;
let mut changed_entries = Vec::new();
let mut new_entries = Vec::new();
let mut conflict_entries = Vec::new();