Expand description
Composable git repository interfaces backed by libgit2 and the git CLI.
This crate provides capability-based traits for git operations:
RepositoryandExecutorfor core repository access and raw CLI executionDiffer,IgnoreReader,TreeReader,LogReader,Blamer, andInspectorfor read flowsIndexManager,Committer, and related write traits for mutating operationsRefManager,RemoteManager,ConfigReader, andMaintainerfor management
The default backend uses git2 (libgit2) for embedded operations and delegates several
core mutating operations (merge, rebase, checkout, reset, stash, cherry-pick, maintenance)
to the git CLI binary. A git binary must be available on PATH at runtime.
Network operations (fetch, push) use the embedded git2 backend.
§Usage
use rskit_git::{Differ, Repository, open};
let repo = open("/path/to/repo").unwrap();
let dirty = repo.is_dirty().unwrap();
let _status = repo.status().unwrap();
assert!(!repo.root().as_os_str().is_empty() || !dirty);Re-exports§
pub use core::Executor;pub use core::Repository;pub use error::GitError;pub use manage::ConfigReader;pub use manage::Maintainer;pub use manage::RefManager;pub use manage::RemoteManager;pub use paths::join_repo_path;pub use paths::repo_relative_path;pub use read::Blamer;pub use read::Differ;pub use read::IgnoreReader;pub use read::IndexReader;pub use read::Inspector;pub use read::LogReader;pub use read::TreeReader;pub use repo::Repo;pub use repo::clone;pub use repo::discover;pub use repo::init;pub use repo::init_bare;pub use repo::open;pub use write::CheckoutManager;pub use write::CherryPicker;pub use write::Committer;pub use write::IndexManager;pub use write::Merger;pub use write::Rebaser;pub use write::Resetter;pub use write::Stasher;pub use options::*;pub use types::*;
Modules§
- auth
- Authentication and signing support types.
- cli
- Git CLI implementation for command-oriented workflows.
- core
- Core git repository traits.
- embedded
- Embedded libgit2 repository implementation.
- error
- Git-specific error types.
- manage
- Repository management traits.
- options
- Option types for git operations.
- paths
- Git repository path helpers.
- read
- Read-oriented git traits.
- repo
- Repository orchestrator that delegates to libgit2 and Git CLI implementations.
- testutil
- Test utilities for the git module.
- types
- Shared types for git operations.
- write
- Write-oriented git traits.
Structs§
- AppError
- Application-level structured error.
Type Aliases§
- AppResult
- Convenience alias used throughout rskit crates.