export tree: avoid confusing output about renaming files

When a file in the export is renamed, and the remote's renameExport
returned Nothing, renaming to the temp file would first say it was
renaming, and appear to succeed, but actually what it did was delete the
file. Then renaming from the temp file would not do anything, since the
temp file is not present on the remote. This appeared as if a file got
renamed to a temp file and left there.

Note that exporttree=yes importree=yes remotes have their usual
renameExport replaced with one that returns Nothing. (For reasons
explained in Remote.Helper.ExportImport.) So this happened
even with remotes that support renameExport.

Fix by letting renameExport = Nothing when it's not supported at all.
This avoids displaying the rename.

Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
Joey Hess 2024-03-09 13:37:51 -04:00
parent 0fb551053b
commit 7cef5e8f35
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 23 additions and 23 deletions

View file

@ -104,7 +104,7 @@ gen r u rc gc rs = do
, versionedExport = False
, removeExportDirectory = Just $
removeExportDirectoryDav hdl
, renameExport = renameExportDav hdl
, renameExport = Just $ renameExportDav hdl
}
, importActions = importUnsupported
, whereisKey = Nothing