update changes title right away

This commit is contained in:
Stephan Dilly 2020-07-12 13:56:10 +02:00
parent 315cf615e0
commit f4e2b7c6c0
2 changed files with 9 additions and 5 deletions

View File

@ -65,8 +65,7 @@ impl ChangesComponent {
}
}
///
pub fn update(&mut self, list: &[StatusItem]) -> Result<()> {
pub fn update(&mut self) -> Result<()> {
if self.is_working_dir {
if let Ok(branch_name) = self.branch_name.lookup() {
self.files.set_title(format!(
@ -75,9 +74,12 @@ impl ChangesComponent {
))
}
}
Ok(())
}
///
pub fn set_items(&mut self, list: &[StatusItem]) -> Result<()> {
self.files.update(list)?;
Ok(())
}

View File

@ -202,6 +202,8 @@ impl Status {
))?;
self.git_status_stage
.fetch(StatusParams::new(StatusType::Stage, true))?;
self.index_wd.update()?;
}
Ok(())
@ -230,10 +232,10 @@ impl Status {
fn update_status(&mut self) -> Result<()> {
let status = self.git_status_stage.last()?;
self.index.update(&status.items)?;
self.index.set_items(&status.items)?;
let status = self.git_status_workdir.last()?;
self.index_wd.update(&status.items)?;
self.index_wd.set_items(&status.items)?;
self.update_diff()?;