mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 08:53:16 +00:00
files: extract pre-processing part from merge()
I'll make the first half generic over T: AsRef<[u8]>.
This commit is contained in:
parent
5a58030b69
commit
e5b49c7d52
1 changed files with 3 additions and 1 deletions
|
@ -162,8 +162,10 @@ pub fn merge(slices: &Merge<&[u8]>) -> MergeResult {
|
|||
// more than 3 parts?
|
||||
let num_diffs = slices.removes().len();
|
||||
let diff_inputs = slices.removes().chain(slices.adds());
|
||||
merge_hunks(&Diff::by_line(diff_inputs), num_diffs)
|
||||
}
|
||||
|
||||
let diff = Diff::by_line(diff_inputs);
|
||||
fn merge_hunks(diff: &Diff, num_diffs: usize) -> MergeResult {
|
||||
let mut resolved_hunk = ContentHunk(vec![]);
|
||||
let mut merge_hunks: Vec<Merge<ContentHunk>> = vec![];
|
||||
for diff_hunk in diff.hunks() {
|
||||
|
|
Loading…
Reference in a new issue