Skip to main content

Module worktree

Module worktree 

Source
Expand description

An executor that materializes what it is asked about (D18).

crate::local::LocalRunner runs a command in a directory somebody else prepared. That is fine for one train commit and wrong for a train: crate::MergeQueue tests every member against its own speculative state, so a batch of jobs is a batch of different trees, and running them all in one checkout tests the last one N times and reports the answer under N different subjects. The failure is silent and every verdict is well-formed, which is the shape of a defect nobody finds.

Job::directory already spells the way out. None means the provider materializes Job::subject itself — written for a microVM, and true of anything that can turn a content address into a tree. A git repository can, for the subjects crate::git::GitSpeculator produces, because those are its own commit ids.

So this is the executor that closes the loop: git worktree add --detach per job, the command in that worktree, the worktree removed afterwards. A job that does name a directory is run there untouched, because a caller who prepared a tree has said what they want and the subject is then not ours to interpret.

Structs§

WorktreeRunner
Runs each job in a throwaway worktree of repo at the job’s subject.