1e0f276
//! commit Operation trait for the commit module (commit access on bare repositories based on gix).
use gix::hash::ObjectId;
use crate::commit::types::{Commit, CommitList, Signature};
/// Operation trait for the commit module.
pub trait CommitOps {
fn commit_commit(&self, rev: &str) -> Result<Commit, crate::Error>;
fn commit_by_id(&self, id: &ObjectId) -> Result<Commit, crate::Error>;
fn commit_branch_commit(&self, branch: &str) -> Result<Commit, crate::Error>;
fn commit_tag_commit(&self, tag: &str) -> Result<Commit, crate::Error>;
fn commit_list(&self, limit: u64, skip: u64) -> Result<CommitList, crate::Error>;
fn commit_parent_count(&self, id: &ObjectId) -> Result<usize, crate::Error>;
/// Write a merge commit with the given parents and tree.
fn commit_write_merge(
&self,
parents: Vec<ObjectId>,
tree_id: ObjectId,
message: &str,
author: &Signature,
committer: &Signature,
) -> Result<ObjectId, crate::Error>;
/// Write a squash commit with a single parent.
fn commit_write_squash(
&self,
parent: ObjectId,
tree_id: ObjectId,
message: &str,
author: &Signature,
committer: &Signature,
) -> Result<ObjectId, crate::Error>;
}