mirror of
https://code.sup39.dev/repos/Wqawg
synced 2025-01-29 02:07:50 +09:00
If Git repo is empty (no branches), don't 404, just show basic repo page
This commit is contained in:
parent
0be7f05d31
commit
339c2253f9
1 changed files with 24 additions and 23 deletions
|
@ -119,16 +119,17 @@ loadSourceView git refT dir = do
|
||||||
tags <- G.tagList git
|
tags <- G.tagList git
|
||||||
let refS = T.unpack refT
|
let refS = T.unpack refT
|
||||||
refN = RefName refS
|
refN = RefName refS
|
||||||
msv <- if refN `S.member` branches || refN `S.member` tags
|
msv <-
|
||||||
|
if null branches
|
||||||
|
then return $ Just $ SourceDir $ DirectoryView Nothing [] Nothing
|
||||||
|
else if refN `S.member` branches || refN `S.member` tags
|
||||||
then do
|
then do
|
||||||
tipOid <- resolveName git refS
|
tipOid <- resolveName git refS
|
||||||
mtree <- G.resolveTreeish git $ unObjId tipOid
|
mtree <- G.resolveTreeish git $ unObjId tipOid
|
||||||
case mtree of
|
for mtree $ \ tree -> do
|
||||||
Nothing -> return Nothing
|
|
||||||
Just tree -> do
|
|
||||||
let dir' = map (G.entName . encodeUtf8) dir
|
let dir' = map (G.entName . encodeUtf8) dir
|
||||||
view <- viewPath git tree dir'
|
view <- viewPath git tree dir'
|
||||||
Just <$> case view of
|
case view of
|
||||||
RootView rows -> do
|
RootView rows -> do
|
||||||
mreadme <- findReadme git rows
|
mreadme <- findReadme git rows
|
||||||
let ents = map rowToEntry rows
|
let ents = map rowToEntry rows
|
||||||
|
|
Loading…
Add table
Reference in a new issue