hindsight_git/error.rs
1// Copyright (c) 2026 - present Nicholas D. Crosbie
2// SPDX-License-Identifier: MIT
3
4//! Error types for hindsight-git
5
6use thiserror::Error;
7
8/// Errors that can occur during git operations
9#[derive(Debug, Error)]
10pub enum GitError {
11 /// Error from git2 library
12 #[error("Git error: {0}")]
13 Git2(#[from] git2::Error),
14
15 /// Repository not found at the specified path
16 #[error("Repository not found: {path}")]
17 RepositoryNotFound {
18 /// The path that was searched for a repository
19 path: String,
20 },
21
22 /// Invalid commit reference (branch, tag, or SHA)
23 #[error("Invalid commit reference: {reference}")]
24 InvalidReference {
25 /// The reference string that could not be resolved
26 reference: String,
27 },
28}