pub struct PushedTree { /* private fields */ }Expand description
A checkout of the pushed commit, removed when it goes out of scope.
Implementations§
Source§impl PushedTree
impl PushedTree
Sourcepub fn create(settings: &Settings, repo: &Path, tip: &str) -> Option<PushedTree>
pub fn create(settings: &Settings, repo: &Path, tip: &str) -> Option<PushedTree>
Materialise tip, or None when that is not possible — in which case
the caller falls back to the working tree and says so.
Takes the repository explicitly rather than relying on the working
directory: set_current_dir is process-global, so a test that changed
it would race every other test in the binary.
Checkout AND preparation, for the push-time caller: a snapshot that could not be prepared is no snapshot, said once, here.
Sourcepub fn checkout(repo: &Path, tip: &str) -> Option<PushedTree>
pub fn checkout(repo: &Path, tip: &str) -> Option<PushedTree>
The checkout alone. The rehearsal registers itself between this and
PushedTree::prepare, so an install that takes minutes is visible —
to --status, to a push that would otherwise start over, and to a
newer commit that must cancel it.
Sourcepub fn prepare(&self, settings: &Settings) -> Result<(), String>
pub fn prepare(&self, settings: &Settings) -> Result<(), String>
Make the checkout runnable: carry, dependencies, then
amont.snapshotPrepare. Err says why, in one line.