summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-01-07 10:20:06 +0200
committerLars Wirzenius <liw@liw.fi>2023-01-07 10:20:06 +0200
commit04ceb1247c7e25c2de6bec15905ae119016741d3 (patch)
treeb69e38d6039ff034922accc0a489036e8332db6e
parent9edd0af9798215e4459e63862e777218cda72681 (diff)
downloadriki-04ceb1247c7e25c2de6bec15905ae119016741d3.tar.gz
refactor: only use GitError in src/git.rs
Sponsored-by: author
-rw-r--r--src/git.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/git.rs b/src/git.rs
index c64453a..598b330 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -1,4 +1,3 @@
-use crate::error::SiteError;
use regex::Regex;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
@@ -32,7 +31,7 @@ pub fn git(args: &[&str], cwd: &Path) -> Result<String, GitError> {
}
}
-pub fn git_whatchanged(cwd: &Path) -> Result<HashMap<PathBuf, SystemTime>, SiteError> {
+pub fn git_whatchanged(cwd: &Path) -> Result<HashMap<PathBuf, SystemTime>, GitError> {
let mut files = HashMap::new();
if cwd.join(".git").is_dir() {
let output = git(&["whatchanged", "--pretty=format:%ad", "--date=unix"], cwd)?;
@@ -63,7 +62,7 @@ pub fn git_whatchanged(cwd: &Path) -> Result<HashMap<PathBuf, SystemTime>, SiteE
Ok(files)
}
-pub fn git_dirty(cwd: &Path) -> Result<Vec<PathBuf>, SiteError> {
+pub fn git_dirty(cwd: &Path) -> Result<Vec<PathBuf>, GitError> {
let mut dirty = vec![];
if cwd.join(".git").is_dir() {
let output = git(&["status", "--short"], cwd)?;