diff options
author | Joey Hess <joey@kitenet.net> | 2012-03-06 14:12:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-03-06 14:12:15 -0400 |
commit | dc9049373e8af94f42f31027d963dbd612d678fc (patch) | |
tree | 927405795f18d74455d4b53822e5c6fa7d4dd681 /Command/Add.hs | |
parent | d08ee1a9d20adbc6ead0bba50aadf4c99a6bce46 (diff) |
cleanup
Diffstat (limited to 'Command/Add.hs')
-rw-r--r-- | Command/Add.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Command/Add.hs b/Command/Add.hs index 28971529a..b6b5753af 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -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 |