From 8448355f98bb6f4c9cc4720f8f01b28fefb8a954 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Wed, 4 May 2016 11:10:23 +0000 Subject: [PATCH] In Darcs pull over SSH, support specifying just repo name --- src/Vervis/Ssh.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Vervis/Ssh.hs b/src/Vervis/Ssh.hs index 2aded99..ea97f71 100644 --- a/src/Vervis/Ssh.hs +++ b/src/Vervis/Ssh.hs @@ -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