Skip to content

fix(engine): fix --modify-window to match upstream two-sided clamp - #2509

Merged
oferchen merged 1 commit into
masterfrom
fix/modify-window-two-sided-clamp
Feb 27, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/modify-window-two-sided-clamp

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Fix destination_is_newer() to match upstream generator.c:2502 signed arithmetic: (source_mtime - dest_mtime) < modify_window
  • Previously, source slightly newer within the window would proceed with copy; upstream treats it as "equal" and skips
  • The quick-check system_time_within_window() was already correct; only the --update path was wrong
  • Add 8 unit tests covering both sides of the window boundary (dest newer, source newer, exact boundary, equal timestamps)
  • Fix 3 integration tests to match corrected upstream semantics

Test plan

  • Verify cargo fmt --all -- --check passes
  • Verify cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings passes
  • Verify cargo nextest run --workspace --all-features passes
  • Verify --update --modify-window=N behavior matches upstream rsync 3.4.1

@github-actions github-actions Bot added the bug Something isn't working label Feb 27, 2026
- Fix destination_is_newer() to match upstream generator.c:2502
  signed arithmetic: (source - dest) < modify_window
- Source slightly newer within window now correctly treated as "equal"
  (skip transfer), matching upstream behavior
- Add 8 unit tests covering both sides of the window boundary
- Fix integration tests for correct upstream --update semantics
@oferchen
oferchen force-pushed the fix/modify-window-two-sided-clamp branch from 5dc1d6c to 4de948d Compare February 27, 2026 03:38
@oferchen
oferchen merged commit 33f4d87 into master Feb 27, 2026
8 checks passed
@oferchen
oferchen deleted the fix/modify-window-two-sided-clamp branch February 27, 2026 09:46
oferchen added a commit that referenced this pull request May 1, 2026
fix(engine): fix --modify-window to match upstream two-sided clamp
oferchen added a commit that referenced this pull request May 5, 2026
fix(engine): fix --modify-window to match upstream two-sided clamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant