ensure tmp file is writable, so rsync can resume

It's possible that rsync finishes transferring a file and sets its mode,
but the file transfer to the annex then fails. When resuming, rsync
would then not be able to write to the tmp file.
This commit is contained in:
Joey Hess 2011-04-25 22:04:12 -04:00
parent 4ea9579b42
commit 70d4e7349b

View file

@ -103,6 +103,8 @@ getViaTmp key action = do
checkDiskSpace' (fromIntegral $ fileSize stat) key
else checkDiskSpace key
when e $ liftIO $ allowWrite tmp
getViaTmpUnchecked key action
{- Like getViaTmp, but does not check that there is enough disk space