summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-10 13:08:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-10 13:08:29 -0400
commit43412419ea8c2f26620a0bc837acf6f14f0afb12 (patch)
tree33165430ff51549cf927ed7462a0eac8e937accb
parent361d28e1389e218c1d0baf378a740570a139f730 (diff)
bugfix
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!
-rw-r--r--Core.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Core.hs b/Core.hs
index 304c8a923..f9c9417bd 100644
--- a/Core.hs
+++ b/Core.hs
@@ -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