Every cp transfers the full file even when local and remote are already identical. The API returns file.hashes.sha1Hash on every item, and upload() already computes the local SHA1 to verify the result — so the check is nearly free:
- upload —
GET the target item first; skip the PUT if sha1hash(local).toUpperCase() === result.file.hashes.sha1Hash
- download — same comparison against the local file before writing
Both spots are already marked in the source (// TODO: skip upload if SHA1 is the same, // TODO: avoid download if the SHA1 is the same).
This is also the precondition for a useful rsync (see the sibling issue) — without it, mirroring re-transfers everything on each run.
README TODO: "Skip upload/download if the SHA1 matches".
Every
cptransfers the full file even when local and remote are already identical. The API returnsfile.hashes.sha1Hashon every item, andupload()already computes the local SHA1 to verify the result — so the check is nearly free:GETthe target item first; skip the PUT ifsha1hash(local).toUpperCase() === result.file.hashes.sha1HashBoth spots are already marked in the source (
// TODO: skip upload if SHA1 is the same,// TODO: avoid download if the SHA1 is the same).This is also the precondition for a useful
rsync(see the sibling issue) — without it, mirroring re-transfers everything on each run.README TODO: "Skip upload/download if the SHA1 matches".