use crate::objects::ObjectId;
use crate::porcelain::add::StageOptions;
use crate::porcelain::bulk_index::IndexStagingThresholds;
use crate::porcelain::commit::CommitRequest;
use crate::transfer::FetchOptions;
#[must_use]
pub fn stage_options_staging_thresholds(
mut opts: StageOptions,
thresholds: IndexStagingThresholds,
) -> StageOptions {
opts.staging_thresholds = Some(thresholds);
opts
}
#[must_use]
pub fn stage_options_skip_pathspec_ignore_check(
mut opts: StageOptions,
skip: bool,
) -> StageOptions {
opts.skip_pathspec_ignore_check = skip;
opts
}
#[must_use]
pub fn commit_skip_pre_commit_tree_match(mut req: CommitRequest, skip: bool) -> CommitRequest {
req.skip_pre_commit_tree_match = skip;
req
}
#[must_use]
pub fn fetch_options_pack_spool_only(mut opts: FetchOptions, enabled: bool) -> FetchOptions {
opts.pack_spool_only = enabled;
opts
}
#[must_use]
pub fn fetch_options_promisor_object_wants(
mut opts: FetchOptions,
wants: Vec<ObjectId>,
) -> FetchOptions {
opts.object_wants = wants;
opts.promisor_object_fetch = true;
opts
}