Skip to content

Commit ac67e53

Browse files
committed
dup current branch name in revlog
1 parent 6dfe5ea commit ac67e53

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/components/commitlist.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const ELEMENTS_PER_LINE: usize = 9;
3232
pub struct CommitList {
3333
title: Box<str>,
3434
selection: usize,
35-
branch: Option<String>,
3635
count_total: usize,
3736
items: ItemBatch,
3837
marked: Vec<(usize, CommitId)>,
@@ -56,7 +55,6 @@ impl CommitList {
5655
items: ItemBatch::default(),
5756
marked: Vec::with_capacity(2),
5857
selection: 0,
59-
branch: None,
6058
count_total: 0,
6159
scroll_state: (Instant::now(), 0_f32),
6260
tags: None,
@@ -74,11 +72,6 @@ impl CommitList {
7472
&mut self.items
7573
}
7674

77-
///
78-
pub fn set_branch(&mut self, name: Option<String>) {
79-
self.branch = name;
80-
}
81-
8275
///
8376
pub const fn selection(&self) -> usize {
8477
self.selection
@@ -501,15 +494,11 @@ impl DrawableComponent for CommitList {
501494
selection,
502495
));
503496

504-
let branch_post_fix =
505-
self.branch.as_ref().map(|b| format!("- {{{b}}}"));
506-
507497
let title = format!(
508-
"{} {}/{} {}",
498+
"{} {}/{}",
509499
self.title,
510500
self.count_total.saturating_sub(self.selection),
511501
self.count_total,
512-
branch_post_fix.as_deref().unwrap_or(""),
513502
);
514503

515504
f.render_widget(

src/tabs/revlog.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::{
1212
};
1313
use anyhow::Result;
1414
use asyncgit::{
15-
cached,
1615
sync::{self, get_branches_info, CommitId, RepoPathRef},
1716
AsyncGitNotification, AsyncLog, AsyncTags, CommitFilesParams,
1817
FetchStatus,
@@ -38,7 +37,6 @@ pub struct Revlog {
3837
git_tags: AsyncTags,
3938
queue: Queue,
4039
visible: bool,
41-
branch_name: cached::BranchName,
4240
key_config: SharedKeyConfig,
4341
}
4442

@@ -73,7 +71,6 @@ impl Revlog {
7371
),
7472
git_tags: AsyncTags::new(repo.borrow().clone(), sender),
7573
visible: false,
76-
branch_name: cached::BranchName::new(repo.clone()),
7774
key_config,
7875
}
7976
}
@@ -103,10 +100,6 @@ impl Revlog {
103100

104101
self.git_tags.request(Duration::from_secs(3), false)?;
105102

106-
self.list.set_branch(
107-
self.branch_name.lookup().map(Some).unwrap_or(None),
108-
);
109-
110103
self.list.set_branches(get_branches_info(
111104
&self.repo.borrow(),
112105
true,

0 commit comments

Comments
 (0)