pub struct PatchTextOptions {
pub diff: DiffOptions,
pub abbrev_len: usize,
}Expand description
Options for write_patch (git diff --binary-compatible output for git apply).
Fields§
§diff: DiffOptionsUnified diff hunk settings (algorithm, context, whitespace, renames).
abbrev_len: usizeMinimum abbreviated oid length on index lines for text files (core.abbrev).
Implementations§
Source§impl PatchTextOptions
impl PatchTextOptions
Sourcepub fn from_repo(repo: &Repository, diff: DiffOptions) -> Result<Self>
pub fn from_repo(repo: &Repository, diff: DiffOptions) -> Result<Self>
Resolve core.abbrev and attach line-diff options.
§Errors
Propagates config and ODB errors from abbrev resolution.
Trait Implementations§
Source§impl Clone for PatchTextOptions
impl Clone for PatchTextOptions
Auto Trait Implementations§
impl Freeze for PatchTextOptions
impl RefUnwindSafe for PatchTextOptions
impl Send for PatchTextOptions
impl Sync for PatchTextOptions
impl Unpin for PatchTextOptions
impl UnsafeUnpin for PatchTextOptions
impl UnwindSafe for PatchTextOptions
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