Skip to content

Conversation

@wlan0
Copy link
Contributor

@wlan0 wlan0 commented Aug 11, 2025

This PR introduces the Differ with methods:

// Differ protocol
func diff(base: Snapshot?, target: Snapshot) async throws -> Descriptor
func apply(descriptor: Descriptor, to base: Snapshot?) async throws -> Snapshot

It also introduces DiffKey, which is a MerkeTree based key for fast diff computations between two dirs

@wlan0 wlan0 force-pushed the native-build-differ branch 4 times, most recently from b16a605 to 298f486 Compare August 11, 2025 22:28
@wlan0 wlan0 force-pushed the native-build-differ branch from 298f486 to 6c06d63 Compare August 12, 2025 00:26
@wlan0 wlan0 force-pushed the native-build-differ branch from 6c06d63 to 08c93bd Compare August 12, 2025 05:18
Comment on lines +295 to +299
// Alternative test: ensure original path with valid UTF-8 round-trips correctly
let utf8Path = BinaryPath(string: "/usr/local/bin")
let utf8Data = try encoder.encode(utf8Path)
let utf8Decoded = try decoder.decode(BinaryPath.self, from: utf8Data)
#expect(utf8Path == utf8Decoded)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is covered already in CodableWithValidUTF8

Comment on lines +329 to +336
@Test func PathWithMultipleSlashes() {
let path = BinaryPath(string: "//usr///local//bin//")
let components = path.components
#expect(components.count == 3)
#expect(components[0].stringValue == "usr")
#expect(components[1].stringValue == "local")
#expect(components[2].stringValue == "bin")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already covered in PathComponents

Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor comments on the tests, otherwise LGTM

@wlan0 wlan0 merged commit 0885cdd into main Aug 12, 2025
2 checks passed
@wlan0 wlan0 deleted the native-build-differ branch August 12, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants