summaryrefslogtreecommitdiffstats
path: root/src/git.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2022-11-07 14:06:33 +0100
committerqkzk <qu3nt1n@gmail.com>2022-11-07 14:06:33 +0100
commit6e0fcde08d109997f02f83d85f98d018b00c5f07 (patch)
tree31f73d83bb257f3ce658b4f1653b40c32a6ce5e3 /src/git.rs
parent5d18139b22f20f37eb4a3dc7f7c3fd87e00882de (diff)
readme. Propagate write errors to callergit
Diffstat (limited to 'src/git.rs')
-rw-r--r--src/git.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/git.rs b/src/git.rs
index 8dbbe74..8e121d8 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -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());