pub struct GitConfigContext { /* private fields */ }Expand description
The resolved Git directory layout for a repository, used to read remote
definitions from .git/config and its layered companions.
Implementations§
Source§impl GitConfigContext
impl GitConfigContext
pub fn discover(root: &Path) -> Option<Self>
pub fn common_dir(&self) -> &Path
Sourcepub fn layered_paths(&self) -> Vec<PathBuf>
pub fn layered_paths(&self) -> Vec<PathBuf>
The standard repository config files, ordered highest-precedence first:
the per-worktree config.worktree (only when extensions.worktreeConfig
is enabled), then the git-dir config, then the shared common-dir
config for linked worktrees.
Sourcepub fn write_file_for(
&self,
name: &str,
) -> Result<PathBuf, IncludedGitRemoteConfigError>
pub fn write_file_for( &self, name: &str, ) -> Result<PathBuf, IncludedGitRemoteConfigError>
The file a write to remote name must target so the next
remote list read resolves the value we just wrote.
Sourcepub fn remove_files_for(
&self,
name: &str,
) -> Result<Vec<PathBuf>, IncludedGitRemoteConfigError>
pub fn remove_files_for( &self, name: &str, ) -> Result<Vec<PathBuf>, IncludedGitRemoteConfigError>
Every file that currently defines remote name, resolved through
includes. A remove must clear all of them.
Sourcepub fn defining_files_for(&self, name: &str) -> Vec<PathBuf>
pub fn defining_files_for(&self, name: &str) -> Vec<PathBuf>
The file(s) whose [remote "<name>"] section the reader resolves,
following include.path/includeIf. Returned highest-precedence first.
Sourcepub fn owns_config_file(&self, path: &Path) -> bool
pub fn owns_config_file(&self, path: &Path) -> bool
Whether heddle may rewrite path: only config files within the
repository’s own Git directory tree (git-dir / common-dir).
pub fn remotes(&self, paths: Vec<PathBuf>) -> BTreeMap<String, String>
Trait Implementations§
Source§impl Clone for GitConfigContext
impl Clone for GitConfigContext
Source§fn clone(&self) -> GitConfigContext
fn clone(&self) -> GitConfigContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more