two types of byName

Clean up from 9769235d6b.
In some cases, looking up a remote by name even though it has no UUID is
desirable. This includes git annex sync, which can operate on remotes
without an annex, and XMPP pairing, which runs addRemote (with calls
byName) before the UUID of the XMPP remote has been configured in git.
This commit is contained in:
Joey Hess 2013-03-05 15:39:42 -04:00
parent 9e75dce764
commit 921f29c004
10 changed files with 27 additions and 16 deletions

View file

@ -52,7 +52,8 @@ addRemote :: Annex String -> Annex Remote
addRemote a = do
name <- a
void remoteListRefresh
maybe (error "failed to add remote") return =<< Remote.byName (Just name)
maybe (error "failed to add remote") return
=<< Remote.byName (Just name)
{- Inits a rsync special remote, and returns its name. -}
makeRsyncRemote :: String -> String -> Annex String