mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-12 14:40:37 +08:00
cli: Refactor git diff encoding
Move code for writing radicle_surf diff's in git's unified diff format into its own module. Lean on the type system by defining a `UnifiedDiff` trait to provide a method `encode` to encode to the format and another default method to convert to a git 'unified' diff string. Additionally a `Header` struct is added to support processing Unified Diff files. The Header's line numbers must be tracked and modified to produce legal diff files. This is in preparation for DDiff support. Upcoming improvements will include parse unified diff's into these types to support test data.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
//! Git-related functions and types.
|
||||
|
||||
#[path = "git/unified_diff.rs"]
|
||||
pub mod unified_diff;
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::fmt::Display;
|
||||
use std::fs::{File, OpenOptions};
|
||||
|
||||
Reference in New Issue
Block a user