use std::os::unix::process::CommandExt;
use std::process::Command;
-use miette::{Context, IntoDiagnostic, Result, bail, ensure};
+use miette::{Context, IntoDiagnostic, Result, bail, ensure, miette};
use quire::Quire;
// binary handles dispatch to libexec/git-core/ internally.
let subcommand = git_cmd
.strip_prefix("git-")
- .ok_or_else(|| miette::miette!("unexpected git command: {git_cmd}"))?;
+ .ok_or_else(|| miette!("unexpected git command: {git_cmd}"))?;
let err = Command::new("git")
.arg(subcommand)
.arg(".")
-#[derive(Debug, thiserror::Error, miette::Diagnostic)]
+use miette::Diagnostic;
+
+#[derive(Debug, thiserror::Error, Diagnostic)]
pub enum Error {
#[error("not found: {0}")]
NotFound(String),
use std::path::Path;
-use miette::{Result, SourceOffset};
+use miette::{Diagnostic, Result, SourceOffset};
use mlua::{Lua, LuaSerdeExt};
const FENNEL_LUA: &str = include_str!("../vendor/fennel.lua");
/// Error kinds from the Fennel loader.
-#[derive(Debug, thiserror::Error, miette::Diagnostic)]
+#[derive(Debug, thiserror::Error, Diagnostic)]
pub enum FennelError {
#[error("file not found: {0}")]
FileNotFound(String),
use std::path::{Path, PathBuf};
-use miette::{IntoDiagnostic, Result, ensure};
+use miette::{IntoDiagnostic, Result, ensure, miette};
use crate::fennel::Fennel;
use crate::secret::SecretString;
/// `.git` suffix. Used by hooks that receive `GIT_DIR` from git.
pub fn repo_from_path(&self, path: &Path) -> Result<Repo> {
let resolved = self.repos_dir();
- let relative = path.strip_prefix(&resolved).map_err(|_| {
- miette::miette!("path is not under repos directory: {}", path.display())
- })?;
+ let relative = path
+ .strip_prefix(&resolved)
+ .map_err(|_| miette!("path is not under repos directory: {}", path.display()))?;
let name = relative.to_string_lossy();
validate_repo_name(&name)?;
Ok(Repo {