one more bugfix to external special remote creds
The creds are passedthrough in this case, so check for such first to avoid a crash when getRemoteConfigValue sees a type it was not expecting.
This commit is contained in:
parent
5c0dc7dc0b
commit
b072b71c27
2 changed files with 8 additions and 1 deletions
7
Creds.hs
7
Creds.hs
|
@ -113,7 +113,12 @@ getRemoteCredPair c gc storage = maybe fromcache (return . Just) =<< fromenv
|
||||||
fromconfig = do
|
fromconfig = do
|
||||||
let key = credPairRemoteField storage
|
let key = credPairRemoteField storage
|
||||||
mcipher <- remoteCipher' c gc
|
mcipher <- remoteCipher' c gc
|
||||||
case (getRemoteConfigValue key c, mcipher) of
|
-- The RemoteConfig value may be passed through.
|
||||||
|
-- Check for those first, because getRemoteConfigValue
|
||||||
|
-- will throw an error if it does not find it.
|
||||||
|
let getval = M.lookup key (getRemoteConfigPassedThrough c)
|
||||||
|
<|> getRemoteConfigValue key c
|
||||||
|
case (getval, mcipher) of
|
||||||
(Nothing, _) -> return Nothing
|
(Nothing, _) -> return Nothing
|
||||||
(Just enccreds, Just (cipher, storablecipher)) ->
|
(Just enccreds, Just (cipher, storablecipher)) ->
|
||||||
fromenccreds enccreds cipher storablecipher
|
fromenccreds enccreds cipher storablecipher
|
||||||
|
|
|
@ -66,3 +66,5 @@ I can see that gpg is called after SETCREDS and I would have expected there to b
|
||||||
|
|
||||||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||||
Of course ;) In fact. I've actually never used embedcreds. I just had an [issue](https://github.com/Lykos153/git-annex-remote-googledrive/issues/48) raised about it on github.
|
Of course ;) In fact. I've actually never used embedcreds. I just had an [issue](https://github.com/Lykos153/git-annex-remote-googledrive/issues/48) raised about it on github.
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
Loading…
Reference in a new issue