pub enum RepoTarget {
Local {
workdir: PathBuf,
},
Remote {
endpoint: RemoteEndpoint,
workdir: PathBuf,
},
}Expand description
Where a Git query runs. Exactly two real backends exist (0036); there is deliberately no provider trait behind them.
Variants§
Local
A worktree on this machine: libgit2 and local git apply.
Remote
A worktree on endpoint. The workdir names a path on the
remote host — it is never a valid local path, and no libgit2
handle may be opened against it.
Implementations§
Source§impl RepoTarget
impl RepoTarget
Sourcepub fn workdir(&self) -> &Path
pub fn workdir(&self) -> &Path
The repository root as native bytes — locally openable only for
RepoTarget::Local; callers that need to open it must match
on the variant first.
Sourcepub fn remote_file(&self, rel: &Path) -> Option<RemoteFile>
pub fn remote_file(&self, rel: &Path) -> Option<RemoteFile>
The remote-file identity for a repo-relative path (remote repositories only): endpoint plus native path, the identity an open request routes by. A local repository has no remote file.
pub fn is_remote(&self) -> bool
Sourcepub fn rel_of(&self, path: &Path) -> Option<PathBuf>
pub fn rel_of(&self, path: &Path) -> Option<PathBuf>
Repo-relative path for a path inside this repository — the
remote flavor strips the remote workdir. None is the typed
refusal for a path that is not inside the repository at all.
Sourcepub fn abs_of(&self, rel: &Path) -> PathBuf
pub fn abs_of(&self, rel: &Path) -> PathBuf
The absolute path of a repo-relative path on the machine this repository lives on.
pub fn endpoint(&self) -> Option<&RemoteEndpoint>
Trait Implementations§
Source§impl Clone for RepoTarget
impl Clone for RepoTarget
Source§fn clone(&self) -> RepoTarget
fn clone(&self) -> RepoTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more