cleanup
This commit is contained in:
parent
d08ee1a9d2
commit
dc9049373e
1 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
liftIO $ whenM (doesFileExist file) $ removeFile file
|
||||
handle tryharder $ fromAnnex key file
|
||||
logStatus key InfoMissing
|
||||
rethrow
|
||||
whenM (inAnnex key) $ do
|
||||
liftIO $ whenM (doesFileExist file) $ removeFile file
|
||||
handle tryharder $ fromAnnex key file
|
||||
logStatus key InfoMissing
|
||||
throw e
|
||||
where
|
||||
rethrow = throw e
|
||||
|
||||
-- fromAnnex could fail if the file ownership is weird
|
||||
tryharder :: IOException -> Annex ()
|
||||
tryharder _ = do
|
||||
|
|
Loading…
Reference in a new issue