🐙 Templated web page generator for your git repositories
git clone https://github.com/m-col/gitja
Files | Refs | Readme | License

Commit ef3c779b5d0b4e3d3336c09f370d591110568f2f
Parent: 04be7bc2ef0df74aac86332bb6935c8e1c60a97f
Author: mcol <mcol@posteo.net>
Date: 2021-12-04 01:11:19 +0300
Committer: mcol <mcol@posteo.net>
Committed: 2021-12-04 01:11:19 +0300

Ensure commits are reversed so that Repo.head works

src/Repositories.hs Modified

@@ -148,7 +148,7 @@
         , ("repositories", toGVal repos)
         , ("name", toGVal . pack . init . toFilePath $ name)
         , ("description", toGVal description)
-        , ("commits", toGVal . reverse $ commits) -- Could be optimised
+        , ("commits", toGVal commits)
         , ("tree", toGVal tree)
         , ("tags", toGVal tags)
         , ("branches", toGVal branches)
@@ -161,7 +161,7 @@
 -}
 getCommits :: CommitOid LgRepo -> ReaderT LgRepo IO [Commit LgRepo]
 getCommits commitID =
-    sequence . mapMaybe loadCommit
+    fmap reverse . sequence . mapMaybe loadCommit
         <=< runConduit
         $ sourceObjects Nothing commitID False .| sinkList