Struct git_checks::CheckGitContext
source · pub struct CheckGitContext { /* private fields */ }
Expand description
Git context for use in checks.
Implementations§
source§impl CheckGitContext
impl CheckGitContext
sourcepub fn new(workarea: GitWorkArea, topic_owner: Identity) -> Self
pub fn new(workarea: GitWorkArea, topic_owner: Identity) -> Self
Create a new git context for checking a commit.
sourcepub fn topic_owner(&self) -> &Identity
pub fn topic_owner(&self) -> &Identity
The publisher of the branch.
sourcepub fn check_attr<A, P>(&self, attr: A, path: P) -> Result<AttributeState>where
A: AsRef<str>,
P: AsRef<OsStr>,
pub fn check_attr<A, P>(&self, attr: A, path: P) -> Result<AttributeState>where
A: AsRef<str>,
P: AsRef<OsStr>,
Check an attribute of the given path.
sourcepub fn checkout<P>(&self, paths: &[P]) -> Result<()>where
P: AsRef<OsStr>,
👎Deprecated since 3.3.0: UNSAFE: use Content::workarea to check out files
pub fn checkout<P>(&self, paths: &[P]) -> Result<()>where
P: AsRef<OsStr>,
Checkout paths from the index to the filesystem.
Normally, files are not placed into the worktree, so checks which use other tools to inspect file contents do not work. This method checks out files to the working directory and fixes up Git’s knowledge that they are there.
All paths supported by Git’s globbing and searching mechanisms are supported.
sourcepub fn cd_to_work_tree<'a>(&self, cmd: &'a mut Command) -> &'a mut Command
👎Deprecated since 3.3.0: not useful without the checkout method
pub fn cd_to_work_tree<'a>(&self, cmd: &'a mut Command) -> &'a mut Command
Run a command from the work tree root.
sourcepub fn workarea(&self) -> &GitWorkArea
pub fn workarea(&self) -> &GitWorkArea
The workarea used for check operations.
sourcepub fn workarea_mut(&mut self) -> &mut GitWorkArea
pub fn workarea_mut(&mut self) -> &mut GitWorkArea
The workarea used for check operations.
sourcepub fn submodule_config(&self) -> &SubmoduleConfig
pub fn submodule_config(&self) -> &SubmoduleConfig
The submodule configuration for the repository.