The object's directory might exist if the backend picked the same key
as was already present. That could happen, for example, if the sha1 is the
same.

Note that I chose to go ahead and replace the old content with the new.
We don't know if they are the same (even with sha1, their timestamp or
perms could differ), so have to assume the newer one is preffered. Although
it won't propigate to other annexes, so it had better not be significantly
different!
This commit is contained in:
Joey Hess 2010-11-10 13:08:29 -04:00
parent 361d28e138
commit 43412419ea

View file

@ -173,6 +173,7 @@ moveAnnex key src = do
let dir = parentDir dest
liftIO $ do
createDirectoryIfMissing True dir
allowWrite dir -- in case the directory already exists
renameFile src dest
preventWrite dest
preventWrite dir