copyurl: honor --size-only for existing destinations - #9896
Open
git-jxj wants to merge 1 commit into
Open
Conversation
Fixes rclone#9892 Signed-off-by: git-jxj <[email protected]>
Author
|
Could a maintainer rerun the failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Make
copyurl --size-onlyskip an existing destination when its size matches the HTTP response's known Content-Length. With an 8-byte destination containingoriginaland an 8-byte response containingreplaced, the destination is currently overwritten despite--size-only; this change preserves it and reports 0 transferred bytes.The existing GET request still obtains the response headers and filename; the matching body is not passed to the upload path. Unknown lengths still copy normally, and
--no-clobberretains precedence. The help text documents this behavior.Validation:
--no-clobberprecedence.go buildandgo test ./fs/operations ./cmd/copyurl -count=1passed.make quicktestpassed (180 packages, no test filters). Ran as an unprivileged user with a matching CLI on PATH; only the FTP test executable used a loopback network namespace because its passive port range overlaps this host's Kubernetes NodePorts. No test source or host firewall changes were required.golangci-lint run ./fs/operations/... ./cmd/copyurl/...: 0 issues.Linked issue
Fixes #9892
For new or changed backends
Not applicable.
Checklist
test_allpasses for this backend.AI tools assisted implementation, review, and the local executions described above. The account owner's separate personal review/ownership attestation is left unchecked.