1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 17:34:52 +09:00

In Darcs pull over SSH, support specifying just repo name

This commit is contained in:
fr33domlover 2016-05-04 11:10:23 +00:00
parent 099d9a6351
commit 8448355f98

View file

@ -143,8 +143,10 @@ authorize (PublicKey name key) = do
--TOD TODO TODO check paths for safety... no /./ or /../ and so on
darcsRepoSpecP :: Parser RepoSpec
darcsRepoSpecP = SpecUserRepo <$> part <* char '/' <*> part <* char '/'
darcsRepoSpecP = f <$> part <* char '/' <*> optional (part <* char '/')
where
f repo Nothing = SpecRepo repo
f sharer (Just repo) = SpecUserRepo sharer repo
part = takeWhile1 (/= '/')
gitRepoSpecP :: Parser RepoSpec