This commit is contained in:
Joey Hess 2012-03-06 14:12:15 -04:00
parent d08ee1a9d2
commit dc9049373e

View file

@ -58,14 +58,12 @@ perform file = do
- This can be called before or after the symlink is in place. -}
undo :: FilePath -> Key -> IOException -> Annex a
undo file key e = do
unlessM (inAnnex key) rethrow -- no cleanup to do
whenM (inAnnex key) $ do
liftIO $ whenM (doesFileExist file) $ removeFile file
handle tryharder $ fromAnnex key file
logStatus key InfoMissing
rethrow
throw e
where
rethrow = throw e
-- fromAnnex could fail if the file ownership is weird
tryharder :: IOException -> Annex ()
tryharder _ = do