fix: only add selected file

This commit is contained in:
Stephan Dilly 2020-03-17 11:35:22 +01:00
parent f7fef9d5df
commit 3b270dde39
2 changed files with 3 additions and 1 deletions

View File

@ -177,6 +177,7 @@ impl App {
}
}
///
pub fn update(&mut self) {
self.fetch_status();
}
@ -188,7 +189,7 @@ impl App {
let mut index = repo.index().unwrap();
let path = Path::new(self.status.wt_items[i].path.as_str());
index.update_all(path, None).unwrap();
index.add_path(path).unwrap();
index.write().unwrap();
self.update();

View File

@ -14,6 +14,7 @@ use poll::PollResult;
use std::{io, time::Duration};
use tui::{backend::CrosstermBackend, Terminal};
//
fn main() -> Result<()> {
enable_raw_mode()?;
io::stdout()