Skip to content

Commit e864aaa

Browse files
committed
add platform tests and implementation
That way, the platform can be used to perform actual merges. This will also be a good chance to try the API.
1 parent 333a8eb commit e864aaa

File tree

10 files changed

+707
-1066
lines changed

10 files changed

+707
-1066
lines changed

gix-merge/src/blob/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// TODO: remove this - only needed while &mut Vec<u8> isn't used.
22
#![allow(clippy::ptr_arg)]
33

4+
use crate::blob::platform::{DriverChoice, ResourceRef};
45
use bstr::BString;
56
use std::path::PathBuf;
67

@@ -157,3 +158,20 @@ pub struct Platform {
157158
/// The way we convert resources into mergeable states.
158159
filter_mode: pipeline::Mode,
159160
}
161+
162+
/// The product of a [`prepare_merge()`](Platform::prepare_merge()) call to finally
163+
/// perform the merge and retrieve the merge results.
164+
#[derive(Copy, Clone)]
165+
pub struct PlatformRef<'parent> {
166+
/// The platform that hosts the resources, used to access drivers.
167+
pub(super) parent: &'parent Platform,
168+
/// The current or our side of the merge operation.
169+
pub current: ResourceRef<'parent>,
170+
/// The ancestor or base of the merge operation.
171+
pub ancestor: ResourceRef<'parent>,
172+
/// The other or their side of the merge operation.
173+
pub other: ResourceRef<'parent>,
174+
/// Which driver to use according to the resource's configuration,
175+
/// using the path of `current` to read git-attributes.
176+
pub driver: DriverChoice,
177+
}

0 commit comments

Comments
 (0)