git-monitor 3.0.0 → 3.0.1
raw patch · 2 files changed
+15/−14 lines, 2 files
Files
- Main.hs +14/−13
- git-monitor.cabal +1/−1
Main.hs view
@@ -10,6 +10,7 @@ module Main where import Control.Concurrent (threadDelay)+import Control.Exception import Control.Monad import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Logger@@ -307,19 +308,19 @@ readModTime wdir getHash fp oid kind = do let path = wdir </> fp debugL $ "Checking file: " ++ path- status <- liftIO $ getSymbolicLinkStatus path- if isRegularFile status- then Just <$>- (FileEntry- <$> pure (posixSecondsToUTCTime- (realToFrac (modificationTime status)))- <*> pure oid- <*> pure kind- <*> if getHash- then hashContents . BlobString- =<< liftIO (B.readFile path)- else return oid)- else return Nothing+ estatus <- liftIO $ try $ getSymbolicLinkStatus path+ case (estatus :: Either SomeException FileStatus) of+ Right status | isRegularFile status ->+ Just <$> (FileEntry+ <$> pure (posixSecondsToUTCTime+ (realToFrac (modificationTime status)))+ <*> pure oid+ <*> pure kind+ <*> if getHash+ then hashContents . BlobString+ =<< liftIO (B.readFile path)+ else return oid)+ _ -> return Nothing infoL :: MonadIO m => String -> m () infoL = liftIO . infoM "git-monitor"
git-monitor.cabal view
@@ -1,5 +1,5 @@ Name: git-monitor-Version: 3.0.0+Version: 3.0.1 Synopsis: Passively snapshots working tree changes efficiently. Description: Passively snapshots working tree changes efficiently.