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 /src/git.rs | |
parent | 5d18139b22f20f37eb4a3dc7f7c3fd87e00882de (diff) |
readme. Propagate write errors to callergit
Diffstat (limited to 'src/git.rs')
-rw-r--r-- | src/git.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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()); |