diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-01 14:40:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-01 14:40:20 -0400 |
commit | 5aaa2c1a5d9c78932409105cf84c1a712a0ada06 (patch) | |
tree | 2f3e2ffc23e7af9d79019982609818ac474dc332 /Command | |
parent | cbefe5cd014115d2e82affaf7cb006ee592cc048 (diff) | |
parent | 2332b4756f9e089a680f960eb59e6955b4458e4d (diff) |
Merge branch 'master' of ssh://git-annex.branchable.com into sshgcrypt
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Direct.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Command/Direct.hs b/Command/Direct.hs index 7835988b4..7485f41ce 100644 --- a/Command/Direct.hs +++ b/Command/Direct.hs @@ -7,6 +7,8 @@ module Command.Direct where +import Control.Exception.Extensible + import Common.Annex import Command import qualified Git @@ -15,6 +17,7 @@ import qualified Git.LsFiles import Config import Annex.Direct import Annex.Version +import Annex.Exception def :: [Command] def = [notBareRepo $ noDaemonRunning $ @@ -51,10 +54,17 @@ perform = do Nothing -> noop Just a -> do showStart "direct" f - a - showEndOk + r <- tryAnnex a + case r of + Left e -> warnlocked e + Right _ -> showEndOk return Nothing + warnlocked :: SomeException -> Annex () + warnlocked e = do + warning $ show e + warning "leaving this file as-is; correct this problem and run git annex fsck on it" + cleanup :: CommandCleanup cleanup = do showStart "direct" "" |