Skip to content

fix(cp): skip equal timestamps with update flag - #1278

Open
sergioperezcheco wants to merge 1 commit into
shelljs:mainfrom
sergioperezcheco:fix/cp-update-equal-timestamps
Open

sergioperezcheco wants to merge 1 commit into
shelljs:mainfrom
sergioperezcheco:fix/cp-update-equal-timestamps

Conversation

@sergioperezcheco

Copy link
Copy Markdown
Contributor

cp -u is documented to copy only when the source is newer, but the timestamp guard currently copies when source and destination have equal mtimes. This can overwrite different destination contents even though the update condition is not met.

Include equality in the skip condition and add direct and recursive regression tests, with newer, older and missing destinations as controls. The full local test suite and coverage run pass on macOS with Node 22, along with ESLint and the Node-support check; the cross-platform CI matrix has not been run locally.

Prepared and reviewed by an automated Hermes agent with OpenAI assistance; no human review is claimed.

Assisted-by: Hermes Agent (OpenAI)
Signed-off-by: sergioperezcheco <checo520@outlook.com>
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