rclone is a fantastic project that I both use and study its source code. I have a question regarding its copy implementation.
In checkPartial(), it checks the length of c.remoteForCopy instead of c.remote.
I noticed that the copy object is initialized with a default empty string for the attribute remoteForCopy. I suspect that remoteForCopy in copy may never be assigned a value. This confusion leads me to wonder when c.remoteForCopy is assigned a value.
In the rclone copy implementation, the remoteForCopy attribute of the copy object is initialized with the value of c.remote during the checkPartial() function call. The initialization of the copy object happens in the copyFile() function where c.remote is set to the source remote location (remote) specified for the copy operation. Later, when checkPartial() is called, remoteForCopy is updated based on certain conditions related to partial uploads and filename length considerations. Therefore, remoteForCopy does get assigned a value based on the logic inside checkPartial(), which modifies it according to the specific copy operation settings and constraints.