pub enum GitExec<'a> {
Local {
workdir: &'a Path,
},
Remote {
endpoint: RemoteEndpoint,
workdir: &'a Path,
},
}Expand description
Where one Git query executes. Constructed from a RepoTarget so a
remote workdir can only ever reach the remote variant.
Variants§
Implementations§
Source§impl<'a> GitExec<'a>
impl<'a> GitExec<'a>
Sourcepub fn for_target(target: &'a RepoTarget) -> Self
pub fn for_target(target: &'a RepoTarget) -> Self
The backend for a repository target: the local worktree runs
git -C <workdir> in-process; the remote worktree rides one
bounded supervised connection per run. No client state is held
between runs.
Sourcepub fn run(
&self,
argv: &[OsString],
cancel: &CancelToken,
) -> Result<GitRun, GitExecError>
pub fn run( &self, argv: &[OsString], cancel: &CancelToken, ) -> Result<GitRun, GitExecError>
Run one bounded git <argv> in the repository. argv excludes
the workdir placement — the local variant prefixes -C, the
remote variant sets the supervised cwd — so every argv element
stays one inert argument on both sides, including filenames with
spaces, newlines or non-UTF-8 bytes.
Sourcepub fn run_records(
&self,
op: &str,
argv: &[OsString],
cancel: &CancelToken,
) -> Result<Vec<u8>, String>
pub fn run_records( &self, op: &str, argv: &[OsString], cancel: &CancelToken, ) -> Result<Vec<u8>, String>
Run one bounded git invocation that must exit zero with a
complete stdout record stream, returning those bytes. Nonzero
exits and truncated output are typed errors carrying git’s own
stderr — the shared shape every memory query wants.