diff options
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r-- | Remote/Git.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs index 5c10c0fc9..3725edd3a 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -7,8 +7,8 @@ module Remote.Git (remote, repoAvail) where -import Control.Exception.Extensible import qualified Data.Map as M +import Control.Exception.Extensible import Common.Annex import Utility.CopyFile @@ -102,11 +102,8 @@ tryGitConfigRead r where -- Reading config can fail due to IO error or -- for other reasons; catch all possible exceptions. - safely a = do - result <- liftIO (try a :: IO (Either SomeException Git.Repo)) - case result of - Left _ -> return r - Right r' -> return r' + safely a = either (const $ return r) return + =<< liftIO (try a :: IO (Either SomeException Git.Repo)) pipedconfig cmd params = safely $ pOpen ReadFromPipe cmd (toCommand params) $ |