Skip to content

Commit 819472f

Browse files
author
Stephan Dilly
committed
update changes title right away
1 parent 586513b commit 819472f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: src/components/changes.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ impl ChangesComponent {
6565
}
6666
}
6767

68-
///
69-
pub fn update(&mut self, list: &[StatusItem]) -> Result<()> {
68+
pub fn update(&mut self) -> Result<()> {
7069
if self.is_working_dir {
7170
if let Ok(branch_name) = self.branch_name.lookup() {
7271
self.files.set_title(format!(
@@ -75,9 +74,12 @@ impl ChangesComponent {
7574
))
7675
}
7776
}
77+
Ok(())
78+
}
7879

80+
///
81+
pub fn set_items(&mut self, list: &[StatusItem]) -> Result<()> {
7982
self.files.update(list)?;
80-
8183
Ok(())
8284
}
8385

Diff for: src/tabs/status.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ impl Status {
202202
))?;
203203
self.git_status_stage
204204
.fetch(StatusParams::new(StatusType::Stage, true))?;
205+
206+
self.index_wd.update()?;
205207
}
206208

207209
Ok(())
@@ -230,10 +232,10 @@ impl Status {
230232

231233
fn update_status(&mut self) -> Result<()> {
232234
let status = self.git_status_stage.last()?;
233-
self.index.update(&status.items)?;
235+
self.index.set_items(&status.items)?;
234236

235237
let status = self.git_status_workdir.last()?;
236-
self.index_wd.update(&status.items)?;
238+
self.index_wd.set_items(&status.items)?;
237239

238240
self.update_diff()?;
239241

0 commit comments

Comments
 (0)