diff options
Diffstat (limited to 'app/History.hs')
-rw-r--r-- | app/History.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/History.hs b/app/History.hs index 7ed09bc..002ca32 100644 --- a/app/History.hs +++ b/app/History.hs @@ -40,8 +40,8 @@ listEvents = do case commitHashes of [] -> pure [] hashFirst : hashesRest -> do - issuesInitial <- cached (append hashFirst (pack ".all")) (\_ -> getIssuesCommitAll hashFirst) - commitInfos <- mapM (\hash -> cached (append hash (pack ".changed")) (\_ -> getCommitInfo hash)) hashesRest + issuesInitial <- getIssuesCommitAll hashFirst + commitInfos <- mapM getCommitInfo hashesRest commitInfoWorkingTree <- getCommitInfoWorkingTree [] let eventses = getEvents hashFirst issuesInitial (commitInfos ++ [commitInfoWorkingTree]) pure eventses @@ -67,8 +67,8 @@ listIssues sort filters paths = do -- complete issue text and parse it. -- -- @topic caching - issuesInitial <- cached (append hashFirst (pack ".all")) (\_ -> getIssuesCommitAll hashFirst) - commitInfos <- mapM (\hash -> cached (append hash (pack ".changed")) (\_ -> getCommitInfo hash)) hashesRest + issuesInitial <- getIssuesCommitAll hashFirst + commitInfos <- mapM getCommitInfo hashesRest commitInfoWorkingTree <- getCommitInfoWorkingTree paths let eventses = getEvents hashFirst issuesInitial (commitInfos ++ [commitInfoWorkingTree]) let issues = mapMaybe issueFromIssueEvents eventses @@ -124,7 +124,7 @@ data CommitInfo = CommitInfo deriving (Show, Binary, Generic) getCommitInfo :: Text -> IO CommitInfo -getCommitInfo hash = do +getCommitInfo hash = cached (append hash (pack ".changed")) $ \_ -> do (issuesCommitChanged, filesChanged) <- getIssuesAndFilesCommitChanged hash pure $ CommitInfo @@ -237,7 +237,7 @@ getIssuesAndFilesWorkingTreeChanged paths = do -- [tree](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftreeatree) -- of this commit. getIssuesCommitAll :: Text -> IO [Issue] -getIssuesCommitAll hash = do +getIssuesCommitAll hash = cached (append hash (pack ".all")) $ \_ -> do withSystemTempDirectory "history" $ \tmp -> do let cwd = tmp </> unpack hash Git.withWorkingTree cwd hash do |