Skip to content

feat: add FnameCmpType enum for alternate basis selection - #2447

Merged
oferchen merged 1 commit into
masterfrom
feat/fnamecmp-basis-type
Feb 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/fnamecmp-basis-type

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add FnameCmpType enum matching upstream rsync.h FNAMECMP_* constants
  • Variants: BasisDir(u8) (0x00-0x7F), Fname (0x80), PartialDir (0x81), Backup (0x82), Fuzzy (0x83)
  • Replace raw Option<u8> in SenderAttrs::fnamecmp_type and ItemFlags::read_trailing() with Option<FnameCmpType>
  • Wire decode rejects undefined values (0x84-0xFF) with InvalidData error
  • Full from_wire/to_wire, Display, TryFrom<u8> implementations

Closes #289

Test plan

  • 13 unit tests: constant values, wire roundtrips, undefined value rejection, display formatting
  • Updated existing tests in receiver.rs and generator.rs for typed assertions
  • All 22,186 workspace tests pass
  • cargo fmt and cargo clippy pass clean

Add typed representation of upstream rsync's FNAMECMP_* constants from
rsync.h: BasisDir(0x00-0x7F), Fname(0x80), PartialDir(0x81),
Backup(0x82), Fuzzy(0x83). Replace raw Option<u8> in SenderAttrs and
ItemFlags::read_trailing() with Option<FnameCmpType> for type safety.

Wire decode rejects undefined values (0x84-0xFF) with InvalidData error.
@oferchen
oferchen merged commit 1770cb5 into master Feb 22, 2026
9 checks passed
@github-actions github-actions Bot added the enhancement New feature or request label Feb 22, 2026
@oferchen
oferchen deleted the feat/fnamecmp-basis-type branch February 22, 2026 12:32
oferchen added a commit that referenced this pull request May 1, 2026
Add typed representation of upstream rsync's FNAMECMP_* constants from
rsync.h: BasisDir(0x00-0x7F), Fname(0x80), PartialDir(0x81),
Backup(0x82), Fuzzy(0x83). Replace raw Option<u8> in SenderAttrs and
ItemFlags::read_trailing() with Option<FnameCmpType> for type safety.

Wire decode rejects undefined values (0x84-0xFF) with InvalidData error.
oferchen added a commit that referenced this pull request May 5, 2026
Add typed representation of upstream rsync's FNAMECMP_* constants from
rsync.h: BasisDir(0x00-0x7F), Fname(0x80), PartialDir(0x81),
Backup(0x82), Fuzzy(0x83). Replace raw Option<u8> in SenderAttrs and
ItemFlags::read_trailing() with Option<FnameCmpType> for type safety.

Wire decode rejects undefined values (0x84-0xFF) with InvalidData error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant