pub struct GitSpeculator { /* private fields */ }Expand description
A speculator over a real repository: states are commit ids.
Implementations§
Source§impl GitSpeculator
impl GitSpeculator
Sourcepub fn new(repo: PathBuf) -> Self
pub fn new(repo: PathBuf) -> Self
A speculator over repo, a non-bare clone whose worktree it owns.
Sourcepub fn verify(&self, state: &str) -> Result<String, String>
pub fn verify(&self, state: &str) -> Result<String, String>
Whether state names a commit this repository holds.
The queue’s base comes from its caller, and a base that is not a commit would otherwise be discovered as a merge failure against the first change submitted — reported as that author’s problem.
§Errors
The oid is unknown, unparseable, or not a commit.
Trait Implementations§
Source§impl Speculator for GitSpeculator
impl Speculator for GitSpeculator
Source§fn step(&mut self, _base: &str, onto: &str, proposed: &str) -> Step
fn step(&mut self, _base: &str, onto: &str, proposed: &str) -> Step
base is ignored: git finds the merge base itself, and the one
it finds is better than the one the caller declared. The
argument exists for the text implementation, which has no way to
find it.
Source§fn identity(&self, change: &Change) -> String
fn identity(&self, change: &Change) -> String
The patch identity of base..proposed, which is what survives a
rebase: the train rewriting the tip under an author gives the
same edit a new commit id and the same identity here.
An unreadable pair yields a unique identity rather than a shared one. Two changes we could not read are not thereby the same change, and collapsing them would make the queue refuse the second as already landed.
Source§fn subject(&self, state: &str) -> ContentHash
fn subject(&self, state: &str) -> ContentHash
The commit id, as a git-codec ContentHash.
§Panics
If state is not a git object id. Every state after the first
is one this type produced with rev-parse; the first is the
caller’s base, which GitSpeculator::verify exists to check
before a queue is built on it.