summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-04-13 10:17:36 -0400
committerBen Sima <ben@bsima.me>2021-04-13 10:17:36 -0400
commit9975f0541df53c0aa4de16d70e8149e00d3973d1 (patch)
treec318598c1067477847109e70d3c467ff9b4dc981
parent69c276ef8258bcfadf3556d61313e3fd69c5a1ae (diff)
Doc fix and factor for readibility
-rw-r--r--Biz/Devalloc.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs
index 7112020..32fa7f9 100644
--- a/Biz/Devalloc.hs
+++ b/Biz/Devalloc.hs
@@ -1746,8 +1746,8 @@ lastTouched bareRepo path = do
where
calculateAge now n = round <| Time.diffUTCTime now n / Time.nominalDay
--- | Given a git dir and a path inside the git repo, return a list of tuples
--- with number of commits and author.
+-- | Given a git dir and a path inside the git repo, get information about the
+-- authors.
authorsFor ::
FilePath ->
FilePath ->
@@ -1770,12 +1770,12 @@ authorsFor gitDir path =
/> Text.pack
/> Text.lines
/> map (Text.break (== '\t'))
- /> map
- ( \(commits, author) ->
- ( Text.strip commits,
- Text.strip <| Text.takeWhile (/= '<') author,
- Text.strip <| Text.dropAround (`elem` ['<', '>']) <| Text.dropWhile (/= '<') author
- )
+ /> map parseAuthor
+ where
+ parseAuthor (commits, author) =
+ ( Text.strip commits,
+ Text.strip <| Text.takeWhile (/= '<') author,
+ Text.strip <| Text.dropAround (`elem` ['<', '>']) <| Text.dropWhile (/= '<') author
)
spliceCreds :: User -> Text -> Text