diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 14:34:22 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 14:34:22 +0200 |
commit | a88672dac3bdef836023a0fa66ef4ccc69d7f0ca (patch) | |
tree | 0b16c6af3d7852ff74479b9f92278944cee85e4d /app/History.hs | |
parent | f9238c373f505c44b569bc587d610972f7e20b85 (diff) |
refactor: simplify listIssues.. functions
Diffstat (limited to 'app/History.hs')
-rw-r--r-- | app/History.hs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/History.hs b/app/History.hs index 396c309..c04d16a 100644 --- a/app/History.hs +++ b/app/History.hs @@ -95,12 +95,10 @@ cached commit func = do pure blob listIssuesCurrent :: [FilePath] -> IO [Issue] -listIssuesCurrent files = do +listIssuesCurrent paths = do worktree <- getCurrentDirectory - concat - <$> catch - (getIssuesPar worktree =<< (getFiles worktree files)) - (\(InvalidTreeGrepperResult e) -> die e) + files <- getFiles worktree paths + concat <$> (catch (getIssuesPar worktree files) (\(InvalidTreeGrepperResult e) -> die e)) listIssuesOf :: Text -> IO [Issue] listIssuesOf commit = do @@ -109,11 +107,8 @@ listIssuesOf commit = do let worktree = tmp </> unpack commit sh_ (fromString (printf "git worktree add --detach %s %s" (quote worktree) (quote (unpack commit)))) pure worktree - - concat - <$> catch - (getIssuesPar worktree =<< (getFilesChanged worktree)) - (\(InvalidTreeGrepperResult e) -> die e) + files <- getFilesChanged worktree + concat <$> catch (getIssuesPar worktree files) (\(InvalidTreeGrepperResult e) -> die e) forgetGetIssuesExceptions :: UnknownFileExtension -> IO [a] forgetGetIssuesExceptions _ = pure [] |