pub struct Git { /* private fields */ }Expand description
The person’s Git: its program and the variables it runs with, apart from the environment, so that what reads with it may be handed on.
Implementations§
Source§impl Git
impl Git
Sourcepub fn person() -> Self
pub fn person() -> Self
The git that the system finds, with none of the variables that would point it
elsewhere.
Sourcepub fn from_template(template: &Command) -> Self
pub fn from_template(template: &Command) -> Self
The Git of a template: its program, and the variables it sets or takes away, as a test sets them.
Sourcepub fn describe(&self, root: &Path, paths: &[String]) -> Vec<GitRepository>
pub fn describe(&self, root: &Path, paths: &[String]) -> Vec<GitRepository>
What Git says of the repositories at paths in the tree at root: their remotes,
branch, the remote the branch follows, and commit. One that Git cannot read is left
out, which leaves it as the tree records it.
Sourcepub fn describe_one(&self, folder: &Path, path: &str) -> Option<GitRepository>
pub fn describe_one(&self, folder: &Path, path: &str) -> Option<GitRepository>
What Git says of the repository in folder, at path in the tree: its own, never
one above it, with the remotes of its own settings, each at the address it fetches
from, its first.
Sourcepub fn work_only_here(&self, folder: &Path, pinned: Option<&str>) -> Vec<String>
pub fn work_only_here(&self, folder: &Path, pinned: Option<&str>) -> Vec<String>
The work that the repository in folder holds and its remotes lack: changes not
committed, commits not pushed, stashes, a pinned commit that it has and no remote
has, or no remote at all. A reference brings back only what a remote holds.
Sourcepub fn head(&self, folder: &Path) -> Option<String>
pub fn head(&self, folder: &Path) -> Option<String>
The commit that the repository in folder has checked out, in full.
Sourcepub fn clone(&self, to: &ToClone, folder: &Path) -> Result<(), String>
pub fn clone(&self, to: &ToClone, folder: &Path) -> Result<(), String>
Clones a repository into folder, empty and checked by the engine, as to says:
from its remote, with the address after -- so that Git never reads it as an option,
no submodule, its other remotes added, and its branch checked out, at its pinned
commit if it has one. Only a repository the engine did not refuse comes here. Git
speaks English here, so that what it says can be told apart.
§Errors
Returns what Git said, if a step failed.