summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-01 14:10:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-01 14:38:46 -0400
commit5e242ed6de52c52bab51c94a23d8ad1fac80b6a4 (patch)
tree2e950d1d2185f9b4bdba4fbc20b72dac2f3518dc /Remote/Git.hs
parent142ba4db72679fa2b17eb4ae33ac7d9764a71b09 (diff)
fix transferring to gcrypt repo from direct mode repo
recvkey was told it was receiving a HMAC key from a direct mode repo, and that confused it into rejecting the transfer, since it has no way to verify a key using that backend, since there is no HMAC backend. I considered making recvkey skip verification in the case of an unknown backend. However, that could lead to bad results; a key can legitimately be in the annex with a backend that the remote git-annex-shell doesn't know about. Better to keep it rejecting if it cannot verify. Instead, made the gcrypt special remote not set the direct mode flag when sending (and receiving) files. Also, added some recvkey messages when its checks fail, since otherwise all that is shown is a confusing error message from rsync when the remote git-annex-shell exits nonzero.
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 0f3f35811..e8ab57281 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -296,9 +296,10 @@ copyFromRemote' r key file dest
upload u key file noRetry
(rsyncOrCopyFile params object dest)
<&&> checksuccess
- | Git.repoIsSsh (repo r) = feedprogressback $ \feeder ->
+ | Git.repoIsSsh (repo r) = feedprogressback $ \feeder -> do
+ direct <- isDirect
Ssh.rsyncHelper (Just feeder)
- =<< Ssh.rsyncParamsRemote r Download key dest file
+ =<< Ssh.rsyncParamsRemote direct r Download key dest file
| Git.repoIsHttp (repo r) = Annex.Content.downloadUrl (keyUrls (repo r) key) dest
| otherwise = error "copying from non-ssh, non-http remote not supported"
where
@@ -370,9 +371,10 @@ copyToRemote r key file p
guardUsable (repo r) False $ commitOnCleanup r $
copylocal =<< Annex.Content.prepSendAnnex key
| Git.repoIsSsh (repo r) = commitOnCleanup r $
- Annex.Content.sendAnnex key noop $ \object ->
+ Annex.Content.sendAnnex key noop $ \object -> do
+ direct <- isDirect
Ssh.rsyncHelper (Just p)
- =<< Ssh.rsyncParamsRemote r Upload key object file
+ =<< Ssh.rsyncParamsRemote direct r Upload key object file
| otherwise = error "copying to non-ssh repo not supported"
where
copylocal Nothing = return False