diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-09-14 14:49:48 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-09-14 14:49:48 -0400 |
commit | 772f686a33e17ce104d0a9e5cc28a70e28250eb2 (patch) | |
tree | 067ebe52d8b461ca27e56d5944ae1d391972006b /Assistant | |
parent | d8bc62fed9ae2e85235fde7a6cba5f522daf6014 (diff) |
Special remotes configured with autoenable=true will be automatically enabled when git-annex init is run.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/MakeRemote.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs index a5eace724..8a70e30c2 100644 --- a/Assistant/MakeRemote.hs +++ b/Assistant/MakeRemote.hs @@ -16,7 +16,7 @@ import qualified Remote.Rsync as Rsync import qualified Remote.GCrypt as GCrypt import qualified Git import qualified Git.Command -import qualified Command.InitRemote +import qualified Annex.SpecialRemote import Logs.UUID import Logs.Remote import Git.Remote @@ -46,10 +46,10 @@ addRemote a = do {- Inits a rsync special remote, and returns its name. -} makeRsyncRemote :: RemoteName -> String -> Annex String makeRsyncRemote name location = makeRemote name location $ const $ void $ - go =<< Command.InitRemote.findExisting name + go =<< Annex.SpecialRemote.findExisting name where go Nothing = setupSpecialRemote name Rsync.remote config Nothing - (Nothing, Command.InitRemote.newConfig name) + (Nothing, Annex.SpecialRemote.newConfig name) go (Just (u, c)) = setupSpecialRemote name Rsync.remote config Nothing (Just u, c) config = M.fromList @@ -78,16 +78,16 @@ initSpecialRemote name remotetype mcreds config = go 0 go :: Int -> Annex RemoteName go n = do let fullname = if n == 0 then name else name ++ show n - r <- Command.InitRemote.findExisting fullname + r <- Annex.SpecialRemote.findExisting fullname case r of Nothing -> setupSpecialRemote fullname remotetype config mcreds - (Nothing, Command.InitRemote.newConfig fullname) + (Nothing, Annex.SpecialRemote.newConfig fullname) Just _ -> go (n + 1) {- Enables an existing special remote. -} enableSpecialRemote :: SpecialRemoteMaker enableSpecialRemote name remotetype mcreds config = do - r <- Command.InitRemote.findExisting name + r <- Annex.SpecialRemote.findExisting name case r of Nothing -> error $ "Cannot find a special remote named " ++ name Just (u, c) -> setupSpecialRemote' False name remotetype config mcreds (Just u, c) |