diff options
-rw-r--r-- | app/History.hs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/History.hs b/app/History.hs index a12ea6e..21709ae 100644 --- a/app/History.hs +++ b/app/History.hs @@ -12,7 +12,7 @@ import Data.Function ((&)) import Data.List (foldl', intercalate) import Data.Maybe (catMaybes, mapMaybe) import Data.String (fromString) -import Data.Text (Text, append, lines, pack, unpack) +import Data.Text (Text, append, isPrefixOf, lines, pack, unpack) import Data.Text.Encoding (decodeUtf8) import GHC.Generics (Generic) import Issue (Issue (..), fromMatch, id) @@ -43,8 +43,16 @@ listIssues filters paths = do let eventses = getEvents hashFirst issuesInitial (commitInfos ++ [commitInfoWorkingTree]) let issues = mapMaybe issueFromIssueEvents eventses issuesFiltered = filter (applyFilter filters) issues - -- FIXME We have to only consider issues in the specified paths - pure issuesFiltered + issuesWithinPaths = + case paths of + [] -> + issuesFiltered + _ -> + filter withinPaths issuesFiltered + pure issuesWithinPaths + where + withinPaths issue = + any (\path -> isPrefixOf (pack path) (pack issue.file)) paths getCommitHashes :: IO [Text] getCommitHashes = |