Add comments to git functions
This commit is contained in:
parent
d2e78b4c51
commit
2b15a16115
1 changed files with 3 additions and 0 deletions
|
@ -63,6 +63,7 @@ data Server = Server
|
|||
, serverRepos :: HashMap (Either Int Int) [Repository]
|
||||
}
|
||||
|
||||
-- | Return the subdirs of a given dir
|
||||
subdirs :: FilePath -> IO [FilePath]
|
||||
subdirs dir = do
|
||||
_base :/ tree <- buildL dir
|
||||
|
@ -73,6 +74,7 @@ subdirs dir = do
|
|||
in mapMaybe dirName cs
|
||||
_ -> []
|
||||
|
||||
-- | Determine the time of the last commit in a given git branch
|
||||
lastBranchChange :: Git -> String -> IO GitTime
|
||||
lastBranchChange git branch = do
|
||||
mref <- resolveRevision git $ Revision branch []
|
||||
|
@ -80,6 +82,7 @@ lastBranchChange git branch = do
|
|||
let mtime = fmap (personTime . commitCommitter) (join mco)
|
||||
return $ fromMaybe (error "mtime is Nothing") mtime
|
||||
|
||||
-- | Determine the time of the last commit in any branch for a given repo
|
||||
lastChange :: FilePath -> IO DateTime
|
||||
lastChange path = withRepo (fromString path) $ \ git -> do
|
||||
--TODO add a better intro to json-state, the docs are bad there
|
||||
|
|
Loading…
Reference in a new issue