avoid getting creds from environment during autoenable
When autoenabling special remotes of type S3, weddav, or glacier, do not take login credentials from environment variables, as the user may not be expecting the autoenable to happen, and may have those set for other purposes.
This commit is contained in:
parent
02e74c010b
commit
0e44c252c8
14 changed files with 72 additions and 37 deletions
|
@ -136,7 +136,11 @@ gitSetup Init mu _ c _ = do
|
|||
if isNothing mu || mu == Just u
|
||||
then return (c, u)
|
||||
else error "git remote did not have specified uuid"
|
||||
gitSetup (Enable _) (Just u) _ c _ = do
|
||||
gitSetup (Enable _) mu _ c _ = enableRemote mu c
|
||||
gitSetup (AutoEnable _) mu _ c _ = enableRemote mu c
|
||||
|
||||
enableRemote :: Maybe UUID -> RemoteConfig -> Annex (RemoteConfig, UUID)
|
||||
enableRemote (Just u) c = do
|
||||
inRepo $ Git.Command.run
|
||||
[ Param "remote"
|
||||
, Param "add"
|
||||
|
@ -144,7 +148,7 @@ gitSetup (Enable _) (Just u) _ c _ = do
|
|||
, Param $ maybe (giveup "no location") fromProposedAccepted (M.lookup locationField c)
|
||||
]
|
||||
return (c, u)
|
||||
gitSetup (Enable _) Nothing _ _ _ = error "unable to enable git remote with no specified uuid"
|
||||
enableRemote Nothing _ = error "unable to enable git remote with no specified uuid"
|
||||
|
||||
{- It's assumed to be cheap to read the config of non-URL remotes, so this is
|
||||
- done each time git-annex is run in a way that uses remotes, unless
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue