factor out untilTrue
This commit is contained in:
parent
fb68a7881f
commit
e19dc85547
4 changed files with 29 additions and 38 deletions
|
@ -200,10 +200,7 @@ copyFromRemote r key file
|
|||
| Git.repoIsHttp r = liftIO $ downloadurls $ keyUrls r key
|
||||
| otherwise = error "copying from non-ssh, non-http repo not supported"
|
||||
where
|
||||
downloadurls [] = return False
|
||||
downloadurls (u:us) = do
|
||||
ok <- Url.download u file
|
||||
if ok then return ok else downloadurls us
|
||||
downloadurls us = untilTrue us $ \u -> Url.download u file
|
||||
|
||||
{- Tries to copy a key's content to a remote's annex. -}
|
||||
copyToRemote :: Git.Repo -> Key -> Annex Bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue