diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-02-07 14:35:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-02-07 14:55:58 -0400 |
commit | dc0f824c1bc4c9aac1045894983a434eb26196ab (patch) | |
tree | a84543bd5ea46c8655fdd189f148f8bab9e48664 /Remote/Rsync.hs | |
parent | 2d5e728c407f5d3447365211a64b088700834787 (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 'Remote/Rsync.hs')
-rw-r--r-- | Remote/Rsync.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs index 22ef0b2cf..dbaf2acc9 100644 --- a/Remote/Rsync.hs +++ b/Remote/Rsync.hs @@ -137,8 +137,8 @@ rsyncTransport gc url loginopt = maybe [] (\l -> ["-l",l]) login fromNull as xs = if null xs then as else xs -rsyncSetup :: Maybe UUID -> Maybe CredPair -> RemoteConfig -> RemoteGitConfig -> Annex (RemoteConfig, UUID) -rsyncSetup mu _ c gc = do +rsyncSetup :: SetupStage -> Maybe UUID -> Maybe CredPair -> RemoteConfig -> RemoteGitConfig -> Annex (RemoteConfig, UUID) +rsyncSetup _ mu _ c gc = do u <- maybe (liftIO genUUID) return mu -- verify configuration is sane let url = fromMaybe (giveup "Specify rsyncurl=") $ |