Expand description
git checkout command builder using a typestate to enforce that a target
is chosen before the command can be executed.
§Example
use git_proc::{Build, branch::Branch, checkout};
let main = Branch::from_static_or_panic("main");
let _cmd = checkout::new().commit_ish(&main).build();§Typestate guarantees
Executing without a target is a compile error:
ⓘ
use git_proc::{Build, checkout};
let _cmd = checkout::new().build();Selecting more than one target is a compile error:
ⓘ
use git_proc::{branch::Branch, checkout, tag::Tag};
let b = Branch::from_static_or_panic("main");
let t = Tag::from_static_or_panic("v1.0.0");
let _ = checkout::new().commit_ish(&b).commit_ish(&t);Structs§
- Checkout
- Builder for
git checkout.
Functions§
- new
- Create a new
git checkoutcommand builder.