summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-02-07 14:35:58 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-02-07 14:55:58 -0400
commitdc0f824c1bc4c9aac1045894983a434eb26196ab (patch)
treea84543bd5ea46c8655fdd189f148f8bab9e48664 /Command
parent2d5e728c407f5d3447365211a64b088700834787 (diff)
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.
Diffstat (limited to 'Command')
-rw-r--r--Command/EnableRemote.hs2
-rw-r--r--Command/InitRemote.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Command/EnableRemote.hs b/Command/EnableRemote.hs
index 61cd543e6..96efce39c 100644
--- a/Command/EnableRemote.hs
+++ b/Command/EnableRemote.hs
@@ -69,7 +69,7 @@ startSpecialRemote name config (Just (u, c)) = do
performSpecialRemote :: RemoteType -> UUID -> R.RemoteConfig -> RemoteGitConfig -> CommandPerform
performSpecialRemote t u c gc = do
- (c', u') <- R.setup t (Just u) Nothing c gc
+ (c', u') <- R.setup t R.Enable (Just u) Nothing c gc
next $ cleanupSpecialRemote u' c'
cleanupSpecialRemote :: UUID -> R.RemoteConfig -> CommandCleanup
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index e5d7a9039..4a89bed7c 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -46,7 +46,7 @@ start (name:ws) = ifM (isJust <$> findExisting name)
perform :: RemoteType -> String -> R.RemoteConfig -> CommandPerform
perform t name c = do
- (c', u) <- R.setup t Nothing Nothing c def
+ (c', u) <- R.setup t R.Init Nothing Nothing c def
next $ cleanup u name c'
cleanup :: UUID -> String -> R.RemoteConfig -> CommandCleanup