From: Joey Hess Date: Fri, 23 Oct 2020 20:11:39 +0000 (-0400) Subject: use removeDirGeneric here too for consistency X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~106^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b2bf099aa33353dc3d6cd3d3a609e992a93a6112;p=git-annex.git use removeDirGeneric here too for consistency And because it might be more robust on windows. --- diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 377e6ce80f..a4a2c6ccd6 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -195,8 +195,7 @@ store d chunkconfig k b p = liftIO $ do - down. -} finalizeStoreGeneric :: FilePath -> FilePath -> FilePath -> IO () finalizeStoreGeneric d tmp dest = do - void $ tryIO $ allowWrite dest -- may already exist - void $ tryIO $ removeDirectoryRecursive dest -- or not exist + removeDirGeneric d dest createDirectoryUnder d (parentDir dest) renameDirectory tmp dest -- may fail on some filesystems diff --git a/doc/bugs/storeKey_when_already_present_failures_on_Windows/comment_3_c570246b0484ed3694efff62feff968c._comment b/doc/bugs/storeKey_when_already_present_failures_on_Windows/comment_3_c570246b0484ed3694efff62feff968c._comment new file mode 100644 index 0000000000..42ca756f52 --- /dev/null +++ b/doc/bugs/storeKey_when_already_present_failures_on_Windows/comment_3_c570246b0484ed3694efff62feff968c._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2020-10-23T20:10:27Z" + content=""" +Turns out Remote.Directory was using removeDirGeneric everywhere it needed +to remove a directory, except for in what I believe is failing here. +And removeDirGeneric already has a workaround for some windows quirk in it. + +So I changed that to use it too. I don't know if that will fix the problem. +"""]]