From 3b270dde39f1ffa1c230d50076f60c364a36322f Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Tue, 17 Mar 2020 11:35:22 +0100 Subject: [PATCH] fix: only add selected file --- src/app.rs | 3 ++- src/main.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index df2c68de..0c3e106b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -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(); diff --git a/src/main.rs b/src/main.rs index f7484f2a..17b472f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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()