From ac67e53b126ed4358d3f387fb35e9e30c1c6bfdf Mon Sep 17 00:00:00 2001 From: extrawurst Date: Wed, 19 Oct 2022 14:03:04 +0200 Subject: [PATCH] dup current branch name in revlog --- src/components/commitlist.rs | 13 +------------ src/tabs/revlog.rs | 7 ------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index ec92b123..c4540ec6 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -32,7 +32,6 @@ const ELEMENTS_PER_LINE: usize = 9; pub struct CommitList { title: Box, selection: usize, - branch: Option, count_total: usize, items: ItemBatch, marked: Vec<(usize, CommitId)>, @@ -56,7 +55,6 @@ impl CommitList { items: ItemBatch::default(), marked: Vec::with_capacity(2), selection: 0, - branch: None, count_total: 0, scroll_state: (Instant::now(), 0_f32), tags: None, @@ -74,11 +72,6 @@ impl CommitList { &mut self.items } - /// - pub fn set_branch(&mut self, name: Option) { - self.branch = name; - } - /// pub const fn selection(&self) -> usize { self.selection @@ -501,15 +494,11 @@ impl DrawableComponent for CommitList { selection, )); - let branch_post_fix = - self.branch.as_ref().map(|b| format!("- {{{b}}}")); - let title = format!( - "{} {}/{} {}", + "{} {}/{}", self.title, self.count_total.saturating_sub(self.selection), self.count_total, - branch_post_fix.as_deref().unwrap_or(""), ); f.render_widget( diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs index 5443bc64..f7cfc22a 100644 --- a/src/tabs/revlog.rs +++ b/src/tabs/revlog.rs @@ -12,7 +12,6 @@ use crate::{ }; use anyhow::Result; use asyncgit::{ - cached, sync::{self, get_branches_info, CommitId, RepoPathRef}, AsyncGitNotification, AsyncLog, AsyncTags, CommitFilesParams, FetchStatus, @@ -38,7 +37,6 @@ pub struct Revlog { git_tags: AsyncTags, queue: Queue, visible: bool, - branch_name: cached::BranchName, key_config: SharedKeyConfig, } @@ -73,7 +71,6 @@ impl Revlog { ), git_tags: AsyncTags::new(repo.borrow().clone(), sender), visible: false, - branch_name: cached::BranchName::new(repo.clone()), key_config, } } @@ -103,10 +100,6 @@ impl Revlog { self.git_tags.request(Duration::from_secs(3), false)?; - self.list.set_branch( - self.branch_name.lookup().map(Some).unwrap_or(None), - ); - self.list.set_branches(get_branches_info( &self.repo.borrow(), true,