summaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-25 17:29:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-25 17:29:59 -0400
commit4c359d354231d2a1972307469d278e2fcb3fe0f0 (patch)
tree54524077c58d52fc940afd1c37d35afe1b1eaf95 /Remote/Helper/Encryptable.hs
parent956807053d627355157f1df51667b2a61f57ab60 (diff)
Fix cost calculation for non-encrypted remotes.
Encyptable types of remotes that were not actually encrypted still had the encryptedRemoteCostAdj applied to their configured cost, which was a bug.
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index a6e79ddc4..41174cf7c 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -87,7 +87,10 @@ encryptableRemote c storeKeyEncrypted retrieveKeyFileEncrypted r =
retrieveKeyFileCheap = retrieveCheap,
removeKey = withkey $ removeKey r,
hasKey = withkey $ hasKey r,
- cost = cost r + encryptedRemoteCostAdj
+ cost = maybe
+ (cost r)
+ (const $ cost r + encryptedRemoteCostAdj)
+ (extractCipher c)
}
where
store k f p = cip k >>= maybe