summaryrefslogtreecommitdiff
path: root/Creds.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Creds.hs')
-rw-r--r--Creds.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/Creds.hs b/Creds.hs
index f5ea55000..06d3a52f9 100644
--- a/Creds.hs
+++ b/Creds.hs
@@ -34,7 +34,7 @@ data CredPairStorage = CredPairStorage
{- Stores creds in a remote's configuration, if the remote allows
- that. Otherwise, caches them locally. -}
setRemoteCredPair :: RemoteConfig -> CredPairStorage -> Annex RemoteConfig
-setRemoteCredPair c storage = go =<< getRemoteCredPair' c storage
+setRemoteCredPair c storage = go =<< getRemoteCredPair c storage
where
go (Just creds)
| embedCreds c = case credPairRemoteKey storage of
@@ -58,8 +58,8 @@ setRemoteCredPair c storage = go =<< getRemoteCredPair' c storage
{- Gets a remote's credpair, from the environment if set, otherwise
- from the cache in gitAnnexCredsDir, or failing that, from the
- value in RemoteConfig. -}
-getRemoteCredPair :: String -> RemoteConfig -> CredPairStorage -> Annex (Maybe CredPair)
-getRemoteCredPair this c storage = maybe missing (return . Just) =<< getRemoteCredPair' c storage
+getRemoteCredPairFor :: String -> RemoteConfig -> CredPairStorage -> Annex (Maybe CredPair)
+getRemoteCredPairFor this c storage = maybe missing (return . Just) =<< getRemoteCredPair c storage
where
(loginvar, passwordvar) = credPairEnvironment storage
missing = do
@@ -70,8 +70,8 @@ getRemoteCredPair this c storage = maybe missing (return . Just) =<< getRemoteCr
]
return Nothing
-getRemoteCredPair' :: RemoteConfig -> CredPairStorage -> Annex (Maybe CredPair)
-getRemoteCredPair' c storage = maybe fromcache (return . Just) =<< fromenv
+getRemoteCredPair :: RemoteConfig -> CredPairStorage -> Annex (Maybe CredPair)
+getRemoteCredPair c storage = maybe fromcache (return . Just) =<< fromenv
where
fromenv = liftIO $ getEnvCredPair storage
fromcache = maybe fromconfig (return . Just) =<< readCacheCredPair storage
@@ -103,8 +103,6 @@ getEnvCredPair storage = liftM2 (,)
(uenv, penv) = credPairEnvironment storage
get = catchMaybeIO . getEnv
-
-
{- Stores a CredPair in the environment. -}
setEnvCredPair :: CredPair -> CredPairStorage -> IO ()
setEnvCredPair (l, p) storage = do