diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-11 18:31:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-11 18:31:41 -0400 |
commit | 8f99409518d343ded6a1355b4366bd21ee4cf66d (patch) | |
tree | 7833262ce8a3ce484486836e1ecba277f3bf21fb /GitRepo.hs | |
parent | f516b820caa702ee76c85b005fef285b8372c4da (diff) |
simpler exception handling
Diffstat (limited to 'GitRepo.hs')
-rw-r--r-- | GitRepo.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/GitRepo.hs b/GitRepo.hs index d01ba642b..de54f6dca 100644 --- a/GitRepo.hs +++ b/GitRepo.hs @@ -16,8 +16,8 @@ import System.Directory import System.Path import System.Cmd.Utils import System.IO +import System.IO.Error import Data.String.Utils -import Control.Exception import Utility -- a git repository @@ -79,7 +79,7 @@ gitAdd repo file = do {- Queries git-config. -} gitConfigGet :: String -> String -> IO String gitConfigGet name defaultValue = - handle ((\_ -> return defaultValue)::SomeException -> IO String) $ + flip catch (\_ -> return defaultValue) $ pOpen ReadFromPipe "git" ["config", "--get", name] $ \h -> do ret <- hGetLine h return ret |