azurefiles: fix hash getting erased when modtime is set

Before this change, setting an object's modtime with o.SetModTime() (without
updating the file's content) would inadvertently erase its md5 hash.

The documentation notes: "If this property isn't specified on the request, the
property is cleared for the file. Subsequent calls to Get File Properties won't
return this property, unless it's explicitly set on the file again."
https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties#common-request-headers

This change fixes the issue by setting ContentMD5 (and ContentType), to the
extent we have it, during SetModTime.

Discovered on bisync integration tests such as TestBisyncRemoteRemote/resolve
This commit is contained in:
nielash
2025-08-08 23:38:05 -04:00
parent 4b0df05907
commit 2a587d21c4
2 changed files with 7 additions and 6 deletions

View File

@@ -429,8 +429,6 @@ backends:
- TestMultithreadCopyAbort
- backend: "azurefiles"
remote: "TestAzureFiles:"
ignoretests:
- cmd/bisync
- backend: "pcloud"
remote: "TestPcloud:"
fastlist: true