aboutsummaryrefslogtreecommitdiffstats
path: root/app/History.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/History.hs')
-rw-r--r--app/History.hs14
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