#[non_exhaustive]pub struct RepositoryOptions {Show 14 fields
pub environment: Environment,
pub command_runner: Arc<dyn CommandRunner>,
pub change_id_generator: Arc<dyn ChangeIdGenerator>,
pub diagnostics: Arc<dyn DiagnosticSink + Send + Sync>,
pub network_trace: bool,
pub test_assume_different_owner: bool,
pub force_split_index: bool,
pub reference_unix_time: Option<i64>,
pub thread_policy: ThreadPolicy,
pub work_tree: Option<PathBuf>,
pub validate_repository_format: bool,
pub open_for_serving: bool,
pub promisor_fetcher: Option<Arc<dyn PromisorFetcher>>,
pub hook_stdio: HookStdio,
}Expand description
Options passed to repository open/discover with an explicit Environment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.environment: EnvironmentDiscovery and configuration environment.
command_runner: Arc<dyn CommandRunner>Subprocess runner for hooks, filters, and helpers.
change_id_generator: Arc<dyn ChangeIdGenerator>Random bytes for new change ids (grit.changeIds).
diagnostics: Arc<dyn DiagnosticSink + Send + Sync>Where non-fatal warnings and trace events are delivered.
network_trace: boolWhen true, network operations may emit crate::diagnostics::Trace::Network events.
test_assume_different_owner: boolWhen true, treat repository ownership as a different user (safe.directory tests).
force_split_index: boolWhen true, force split-index writes (embedder/test harness).
reference_unix_time: Option<i64>Wall-clock reference for rev-parse date selectors; embedders set explicitly.
thread_policy: ThreadPolicyParallel worker overrides (--threads in the CLI).
work_tree: Option<PathBuf>Work tree path for crate::repo::Repository::open (non-bare repos).
validate_repository_format: boolWhen false, skip crate::repo::validate_repo_format during open.
open_for_serving: boolWhen true, crate::repo::Repository::open resolves path like wire-protocol serving.
promisor_fetcher: Option<Arc<dyn PromisorFetcher>>Optional on-demand fetcher for partial-clone promisor objects.
hook_stdio: HookStdioWhere hook subprocesses write their output (captured by default).
Implementations§
Source§impl RepositoryOptions
impl RepositoryOptions
Sourcepub fn empty() -> RepositoryOptions
pub fn empty() -> RepositoryOptions
Shorthand for Environment::empty.
Sourcepub fn with_environment(environment: Environment) -> RepositoryOptions
pub fn with_environment(environment: Environment) -> RepositoryOptions
Build options around an explicit Environment snapshot.
Sourcepub fn with_command_runner(
self,
runner: Arc<dyn CommandRunner>,
) -> RepositoryOptions
pub fn with_command_runner( self, runner: Arc<dyn CommandRunner>, ) -> RepositoryOptions
Override the injectable subprocess runner used for hooks and filters.
Sourcepub fn with_change_id_generator(
self,
generator: Arc<dyn ChangeIdGenerator>,
) -> RepositoryOptions
pub fn with_change_id_generator( self, generator: Arc<dyn ChangeIdGenerator>, ) -> RepositoryOptions
Override the generator used for random change ids on new commits.
Sourcepub fn with_work_tree(self, work_tree: impl Into<PathBuf>) -> RepositoryOptions
pub fn with_work_tree(self, work_tree: impl Into<PathBuf>) -> RepositoryOptions
Attach an explicit work tree for crate::repo::Repository::open.
Sourcepub fn without_format_validation(self) -> RepositoryOptions
pub fn without_format_validation(self) -> RepositoryOptions
Skip repository format validation when opening (discovery follow-up paths).
Sourcepub fn for_serving(self) -> RepositoryOptions
pub fn for_serving(self) -> RepositoryOptions
Resolve path for smart-HTTP / upload-pack serving instead of a bare git directory.
Sourcepub fn with_diagnostics(
self,
diagnostics: Arc<dyn DiagnosticSink + Send + Sync>,
) -> RepositoryOptions
pub fn with_diagnostics( self, diagnostics: Arc<dyn DiagnosticSink + Send + Sync>, ) -> RepositoryOptions
Override the diagnostic sink for warnings and trace events.
Sourcepub fn with_hook_stdio(self, hook_stdio: HookStdio) -> RepositoryOptions
pub fn with_hook_stdio(self, hook_stdio: HookStdio) -> RepositoryOptions
Choose whether hooks run by repositories opened with these options have their output
captured (HookStdio::Capture, the default) or
write straight to this process’s stderr.
Sourcepub fn with_network_trace(self, network_trace: bool) -> RepositoryOptions
pub fn with_network_trace(self, network_trace: bool) -> RepositoryOptions
Enable or disable network trace events.
Sourcepub fn with_promisor_fetcher(
self,
fetcher: Option<Arc<dyn PromisorFetcher>>,
) -> RepositoryOptions
pub fn with_promisor_fetcher( self, fetcher: Option<Arc<dyn PromisorFetcher>>, ) -> RepositoryOptions
Install a promisor on-demand object fetcher for repositories opened with these options.
Trait Implementations§
Source§impl Clone for RepositoryOptions
impl Clone for RepositoryOptions
Source§fn clone(&self) -> RepositoryOptions
fn clone(&self) -> RepositoryOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more