From 4724a85a528369b3a8c455453bb56571815ca94a Mon Sep 17 00:00:00 2001 From: voidlizard Date: Sat, 7 Dec 2024 13:27:41 +0300 Subject: [PATCH] wip33 --- hbs2-git3/app/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hbs2-git3/app/Main.hs b/hbs2-git3/app/Main.hs index 0406559f..c6aeaee8 100644 --- a/hbs2-git3/app/Main.hs +++ b/hbs2-git3/app/Main.hs @@ -632,7 +632,8 @@ export mref' r = connectedDo $ flip runContT pure do d <- findGitDir >>= orThrow (OtherGitError "git dir not set") - shallow <- liftIO (readFile (d "shallow")) + shallow <- liftIO (try @_ @IOException (readFile (d "shallow"))) + <&> fromRight mempty <&> mapMaybe (fromStringMay @GitHash) . lines <&> HS.fromList @@ -1306,7 +1307,7 @@ theDict = do let shallowFile = d "shallow" new <- readTVarIO _orphans - current <- try @_ @IOError (liftIO $ LBS8.readFile shallowFile) + current <- try @_ @IOException (liftIO $ LBS8.readFile shallowFile) <&> fromRight mempty <&> mapMaybe (fromStringMay @GitHash . LBS8.unpack) . LBS8.lines <&> HS.union new . HS.fromList