pub struct AmendmentHandler { /* private fields */ }Expand description
Amendment operation handler.
Implementations§
Source§impl AmendmentHandler
impl AmendmentHandler
Sourcepub fn new(repo_root: &Path) -> Result<Self>
pub fn new(repo_root: &Path) -> Result<Self>
Creates a new amendment handler for the repository at repo_root.
Sourcepub fn with_allow_pushed(self, allow_pushed: bool) -> Self
pub fn with_allow_pushed(self, allow_pushed: bool) -> Self
Permits amending commits that already exist in remote main branches.
Off by default: amending a pushed commit rewrites published history, so
callers must opt in explicitly (the --allow-pushed CLI flag).
Sourcepub fn apply_amendments(&self, yaml_file: &str) -> Result<()>
pub fn apply_amendments(&self, yaml_file: &str) -> Result<()>
Applies amendments from a YAML file.
Sourcepub fn apply_amendment_file(&self, amendment_file: &AmendmentFile) -> Result<()>
pub fn apply_amendment_file(&self, amendment_file: &AmendmentFile) -> Result<()>
Applies an already-parsed amendment file.
The core of Self::apply_amendments, split out so callers that hold
the amendments in memory (the MCP git_amend_commits tool, which
receives them as an inline YAML string) reuse the identical
safety-check + apply path without a round-trip through a temp file.
Auto Trait Implementations§
impl !Sync for AmendmentHandler
impl Freeze for AmendmentHandler
impl RefUnwindSafe for AmendmentHandler
impl Send for AmendmentHandler
impl Unpin for AmendmentHandler
impl UnsafeUnpin for AmendmentHandler
impl UnwindSafe for AmendmentHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more