From dc0f824c1bc4c9aac1045894983a434eb26196ab Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 7 Feb 2017 14:35:58 -0400 Subject: add SetupStage parameter to RemoteType.setup Most remotes have an idempotent setup that can be reused for enableremote, but in a few cases, it needs to tell which, and whether a UUID was provided to setup was used. This is groundwork for making initremote be able to provide a UUID. It should not change any behavior. Note that it would be nice to make the UUID always be provided to setup, and make setup not need to generate and return a UUID. What prevented this simplification is Remote.Git.gitSetup, which needs to reuse the UUID of the git remote when setting it up, and so has to return that UUID. This commit was sponsored by Thom May on Patreon. --- Annex/SpecialRemote.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Annex/SpecialRemote.hs') diff --git a/Annex/SpecialRemote.hs b/Annex/SpecialRemote.hs index 0fd24f023..3e2b1da0a 100644 --- a/Annex/SpecialRemote.hs +++ b/Annex/SpecialRemote.hs @@ -9,7 +9,7 @@ module Annex.SpecialRemote where import Annex.Common import Remote (remoteTypes, remoteMap) -import Types.Remote (RemoteConfig, RemoteConfigKey, typename, setup) +import Types.Remote (RemoteConfig, RemoteConfigKey, SetupStage(..), typename, setup) import Logs.Remote import Logs.Trust import qualified Git.Config @@ -79,7 +79,7 @@ autoEnable = do case (M.lookup nameKey c, findType c) of (Just name, Right t) -> whenM (canenable u) $ do showSideAction $ "Auto enabling special remote " ++ name - res <- tryNonAsync $ setup t (Just u) Nothing c def + res <- tryNonAsync $ setup t Enable (Just u) Nothing c def case res of Left e -> warning (show e) Right _ -> return () -- cgit v1.2.3