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:
Joey Hess 2020-06-16 18:28:26 -04:00
parent 5c0dc7dc0b
commit b072b71c27
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 8 additions and 1 deletions

View file

@ -113,7 +113,12 @@ getRemoteCredPair c gc storage = maybe fromcache (return . Just) =<< fromenv
fromconfig = do
let key = credPairRemoteField storage
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
(Just enccreds, Just (cipher, storablecipher)) ->
fromenccreds enccreds cipher storablecipher

View file

@ -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)
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]]