Skip to content

Restore directory timestamps after receiving their children - #88

Open
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/preserve-directory-times
Open

Restore directory timestamps after receiving their children#88
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/preserve-directory-times

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Save each received directory's timestamps on its stack frame and apply them when its E directive arrives, after its children have been created.

Reproduction and evidence

A local state-machine reproduction receives T1000000000 123456 1000000010 234567, D0755 0 tree, a child file and E. Before this patch, creating the child replaces the directory's saved mtime; afterward the original seconds and microseconds are retained. Nested-directory integration through a local OpenSSH scp process also passes. That local sender emits whole-second timestamps, so the native check compares its transmitted precision.

Compatibility / breaking changes

No API or dependency change. With preserve enabled, directory timestamps are applied after directory contents complete, rather than before them. Incomplete directory transfers do not receive final preserved timestamps. File timestamp behavior is unchanged.

Verification and limits

  • This focused branch passes the existing upstream suite: 36 tests / 70 assertions, Ruby 4.0.6, net-ssh 7.3.3, test-unit 3.7.8 and Mocha 2.1.0; all Ruby commands used rbenv.
  • The combined release-based consumer candidate passes the suite with frozen string literals enabled, 10 focused cases, 2,906 model assertions, 24 URI-component assertions and 19 local scp/URI assertions. Combined evidence includes other separately proposed fixes and existing upstream frozen-string corrections; it is not attributed to this patch alone.
  • No repository tests added/modified under the consuming project's explicit no-new-tests policy. Reproductions/models ran externally. No deployed servers, SSH connections or production data were used.
  • All seven runtime files parse with the Ruby 2.6 parser; actual older-Ruby/Windows/remote-server matrices were not run locally. No upstream lint config exists; targeted lint has the same eight pre-existing warnings, with no new warnings.
  • Existing upstream PRs/issues and contribution guidance were checked. Maintainer CI results are pending; no CI pass is claimed.

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