pub enum GitExec<'a> {
Local {
workdir: &'a Path,
},
Remote {
endpoint: RemoteEndpoint,
workdir: &'a Path,
},
Container {
container: ContainerId,
workdir: &'a Path,
},
}Expand description
Where one Git query executes. Constructed from a RepoTarget so a
non-local workdir can only ever reach its matching backend.
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; the container worktree
rides one bounded docker exec 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 and container variants prefix
-C, the remote variant sets the supervised cwd — so every argv
element stays one inert argument on every backend, including
filenames with spaces or newlines. (The container boundary
carries argv as UTF-8 text, so a native-byte filename is refused
typed there rather than lossily renamed.)
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.