mirror of
https://code.sup39.dev/repos/Wqawg
synced 2025-03-20 04:46:22 +09:00
Implement git history log in repo page
This commit is contained in:
parent
100d2948cb
commit
b20c672a01
9 changed files with 97 additions and 28 deletions
28
src/Data/ByteString/Char8/Local.hs
Normal file
28
src/Data/ByteString/Char8/Local.hs
Normal file
|
@ -0,0 +1,28 @@
|
|||
{- This file is part of Vervis.
|
||||
-
|
||||
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
|
||||
-
|
||||
- ♡ Copying is an act of love. Please copy, reuse and share.
|
||||
-
|
||||
- The author(s) have dedicated all copyright and related and neighboring
|
||||
- rights to this software to the public domain worldwide. This software is
|
||||
- distributed without any warranty.
|
||||
-
|
||||
- You should have received a copy of the CC0 Public Domain Dedication along
|
||||
- with this software. If not, see
|
||||
- <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
-}
|
||||
|
||||
module Data.ByteString.Char8.Local
|
||||
( takeLine
|
||||
)
|
||||
where
|
||||
|
||||
import Prelude hiding (takeWhile)
|
||||
|
||||
import Data.ByteString.Char8
|
||||
|
||||
import Data.Char.Local (isNewline)
|
||||
|
||||
takeLine :: ByteString -> ByteString
|
||||
takeLine = takeWhile $ not . isNewline
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
module Data.Char.Local
|
||||
( isAsciiLetter
|
||||
, isNewline
|
||||
)
|
||||
where
|
||||
|
||||
|
@ -22,3 +23,6 @@ import Prelude
|
|||
|
||||
isAsciiLetter :: Char -> Bool
|
||||
isAsciiLetter c = 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
|
||||
|
||||
isNewline :: Char -> Bool
|
||||
isNewline c = c == '\n' || c == '\r'
|
||||
|
|
|
@ -154,7 +154,7 @@ loadCommitGraphByName :: Graph g => Git -> String -> IO (CommitGraph g)
|
|||
loadCommitGraphByName git name = do
|
||||
mg <- loadCommitGraphByNameMaybe git name
|
||||
case mg of
|
||||
Nothing -> error ""
|
||||
Nothing -> error "no such ref"
|
||||
Just g -> return g
|
||||
|
||||
-- | Load a commit graph and topsort the commits. The resulting list starts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue