summaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index 374599369..7b91cc342 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -353,11 +353,8 @@ toDirectGen k f = do
void $ addAssociatedFile k f
modifyContent loc $ do
thawContent loc
- replaceFileOr f
- (liftIO . moveFile loc)
- $ \tmp -> do -- rollback
- liftIO (moveFile tmp loc)
- freezeContent loc
+ liftIO (replaceFileFrom loc f)
+ `catchIO` (\_ -> freezeContent loc)
fromdirect loc = do
replaceFile f $
liftIO . void . copyFileExternal loc