diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 14:11:05 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 14:11:05 +0200 |
commit | e8787affc807cb640a69a5c30a673580ab1551f3 (patch) | |
tree | ef19063b0a989873f046874f4f994d3662ec3280 /app/History.hs | |
parent | 6a85629bff02e439d141de1a9719248864594a0c (diff) |
fix: filter after caching issues
Diffstat (limited to 'app/History.hs')
-rw-r--r-- | app/History.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/History.hs b/app/History.hs index 8ec47fa..a59a5f1 100644 --- a/app/History.hs +++ b/app/History.hs @@ -50,9 +50,9 @@ listIssues filters files = do ( \maybeCommit -> case maybeCommit of Nothing -> - listIssuesOf Nothing filters files + listIssuesOf Nothing files Just commit -> - cached commit (\_ -> listIssuesOf (Just commit) filters files) + cached commit (\_ -> listIssuesOf (Just commit) files) ) $ (:) Nothing $ map Just commits @@ -62,7 +62,9 @@ listIssues filters files = do pure (currentIssues, concat historicalIssueses) [] -> die "no commits" - pure (map (merge . pick historicalIssues) currentIssues) + pure $ + map (merge . pick historicalIssues) $ + filter (applyFilter filters) currentIssues pick :: [Issue] -> Issue -> (Issue, [Issue]) pick issues issue = @@ -92,8 +94,8 @@ cached commit func = do encodeFile file blob pure blob -listIssuesOf :: Maybe Text -> [Filter] -> [FilePath] -> IO [Issue] -listIssuesOf maybeCommit filters files = do +listIssuesOf :: Maybe Text -> [FilePath] -> IO [Issue] +listIssuesOf maybeCommit files = do issue <- withSystemTempDirectory "history" $ \tmp -> do worktree <- case maybeCommit of @@ -104,7 +106,7 @@ listIssuesOf maybeCommit filters files = do sh_ (fromString (printf "git worktree add --detach %s %s" (quote worktree) (quote (unpack commit)))) pure worktree - filter (applyFilter filters) . concat + concat <$> catch ( parMapM (handle forgetGetIssuesExceptions . getIssues worktree) =<< ( case maybeCommit of |