summaryrefslogtreecommitdiff
path: root/Command/EnableRemote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-14 14:49:48 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-14 14:49:48 -0400
commit772f686a33e17ce104d0a9e5cc28a70e28250eb2 (patch)
tree067ebe52d8b461ca27e56d5944ae1d391972006b /Command/EnableRemote.hs
parentd8bc62fed9ae2e85235fde7a6cba5f522daf6014 (diff)
Special remotes configured with autoenable=true will be automatically enabled when git-annex init is run.
Diffstat (limited to 'Command/EnableRemote.hs')
-rw-r--r--Command/EnableRemote.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Command/EnableRemote.hs b/Command/EnableRemote.hs
index 1d4c4af5e..84216dd78 100644
--- a/Command/EnableRemote.hs
+++ b/Command/EnableRemote.hs
@@ -11,7 +11,7 @@ import Common.Annex
import Command
import qualified Logs.Remote
import qualified Types.Remote as R
-import qualified Command.InitRemote as InitRemote
+import qualified Annex.SpecialRemote
import qualified Data.Map as M
@@ -26,21 +26,20 @@ seek = withWords start
start :: [String] -> CommandStart
start [] = unknownNameError "Specify the name of the special remote to enable."
-start (name:ws) = go =<< InitRemote.findExisting name
+start (name:ws) = go =<< Annex.SpecialRemote.findExisting name
where
config = Logs.Remote.keyValToConfig ws
go Nothing = unknownNameError "Unknown special remote name."
go (Just (u, c)) = do
let fullconfig = config `M.union` c
- t <- InitRemote.findType fullconfig
-
+ t <- either error return (Annex.SpecialRemote.findType fullconfig)
showStart "enableremote" name
next $ perform t u fullconfig
unknownNameError :: String -> Annex a
unknownNameError prefix = do
- names <- InitRemote.remoteNames
+ names <- Annex.SpecialRemote.remoteNames
error $ prefix ++ "\n" ++
if null names
then "(No special remotes are currently known; perhaps use initremote instead?)"