diff options
Diffstat (limited to 'Utility/ExternalSHA.hs')
-rw-r--r-- | Utility/ExternalSHA.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Utility/ExternalSHA.hs b/Utility/ExternalSHA.hs index 1ab93262d..595acd8cf 100644 --- a/Utility/ExternalSHA.hs +++ b/Utility/ExternalSHA.hs @@ -14,6 +14,7 @@ import Utility.SafeCommand import Utility.Process import Utility.FileSystemEncoding import Utility.Misc +import Utility.Exception import Data.List import Data.Char @@ -22,7 +23,7 @@ import System.IO externalSHA :: String -> Int -> FilePath -> IO (Either String String) externalSHA command shasize file = do - ls <- lines <$> readsha (toCommand [File file]) + ls <- lines <$> catchDefaultIO "" (readsha (toCommand [File file])) return $ sanitycheck =<< parse ls where {- sha commands output the filename, so need to set fileEncoding -} |