Skip to content

Fix/logic errors#17

Closed
woelper wants to merge 2 commits into
masterfrom
fix/logic_errors
Closed

Fix/logic errors#17
woelper wants to merge 2 commits into
masterfrom
fix/logic_errors

Conversation

@woelper

@woelper woelper commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Swap doc comments on exclude_filters/include_filters (they were reversed)
Fix AND-vs-OR logic bug in run(): when both overwrite_if_newer and
overwrite_if_size_differs are set, the old code required both conditions
to be true (AND semantics). Each check could independently continue-skip
the file, so a newer file with the same size would be skipped even though
overwrite_if_newer was satisfied. Changed to OR semantics: copy if any
enabled condition matches.
Fix the same first-wins bug in copy_file() (jwalk path): overwrite_if_newer
always returned early, so overwrite_if_size_differs was never evaluated when
both flags were set.

woelper added 2 commits April 15, 2026 18:24
…mments

- Swap doc comments on exclude_filters/include_filters (they were reversed)
- Fix AND-vs-OR logic bug in run(): when both overwrite_if_newer and
  overwrite_if_size_differs are set, the old code required both conditions
  to be true (AND semantics). Each check could independently continue-skip
  the file, so a newer file with the same size would be skipped even though
  overwrite_if_newer was satisfied. Changed to OR semantics: copy if any
  enabled condition matches.
- Fix the same first-wins bug in copy_file() (jwalk path): overwrite_if_newer
  always returned early, so overwrite_if_size_differs was never evaluated when
  both flags were set.

https://claude.ai/code/session_01VLuMqvewnrGXovLZ4Reqss
…ogic

Tests for bug 2 (run()) and bug 3 (run_par() / copy_file()):
- overwrite_or_newer_same_size: source IS newer, same size → must copy
- overwrite_or_size_differs_not_newer: sizes differ, source is older → must copy
Both scenarios are covered for both run() and run_par() (jwalk path).
These tests would have failed under the old AND-semantics implementation.

https://claude.ai/code/session_01VLuMqvewnrGXovLZ4Reqss
@woelper woelper closed this Apr 15, 2026
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.

1 participant