diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-11-07 14:06:33 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-11-07 14:06:33 +0100 |
commit | 6e0fcde08d109997f02f83d85f98d018b00c5f07 (patch) | |
tree | 31f73d83bb257f3ce658b4f1653b40c32a6ce5e3 | |
parent | 5d18139b22f20f37eb4a3dc7f7c3fd87e00882de (diff) |
readme. Propagate write errors to callergit
-rw-r--r-- | readme.md | 1 | ||||
-rw-r--r-- | src/display.rs | 2 | ||||
-rw-r--r-- | src/git.rs | 4 |
3 files changed, 4 insertions, 3 deletions
@@ -97,6 +97,7 @@ - [x] drag & drop: exec and find dragon-drop - [x] optional numbers in preview - [x] logging with rotating log files. +- [x] git integration in first line of normal mode. ## TODO diff --git a/src/display.rs b/src/display.rs index 3cf13194..9e09afea 100644 --- a/src/display.rs +++ b/src/display.rs @@ -90,7 +90,7 @@ impl Display { let tab = status.selected_non_mut(); let first_row: String = match tab.mode { Mode::Normal => { - let git_string = git(tab.path_content.path.clone())?; + let git_string = git(&tab.path_content.path)?; format!( "Tab: {}/{} -- Path: {} -- Files: {} -- {}", status.index + 1, @@ -4,7 +4,7 @@ use std::error::Error; use std::fmt::Write as _; -use std::path::PathBuf; +use std::path::Path; use std::process; struct GitStatus { @@ -73,7 +73,7 @@ fn parse_porcelain2(data: String) -> Option<GitStatus> { Some(status) } -pub fn git(path: PathBuf) -> Result<String, Box<dyn Error>> { +pub fn git(path: &Path) -> Result<String, Box<dyn Error>> { if std::env::set_current_dir(&path).is_err() { // The path may not exist. It should never happen. return Ok("".to_owned()); |