summaryrefslogtreecommitdiff
path: root/Command/RecvKey.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-26 13:59:27 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-26 13:59:27 -0400
commit483abf98b1949b88c3e96c987378be23f8ed869a (patch)
treebc3e75200ea69bf837ccd08a266ca4528efde09b /Command/RecvKey.hs
parent274dbabd972da62e4480bc09fa62bbcdf6f72e6f (diff)
add unlocked flag for git-annex-shell recvkey
The direct flag is also set when sending unlocked content, to support old versions of git-annex-shell. At some point, the direct flag will be removed, and only the unlocked flag will be used.
Diffstat (limited to 'Command/RecvKey.hs')
-rw-r--r--Command/RecvKey.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Command/RecvKey.hs b/Command/RecvKey.hs
index 988c4f90e..51bf69b1f 100644
--- a/Command/RecvKey.hs
+++ b/Command/RecvKey.hs
@@ -27,10 +27,11 @@ seek = withKeys start
start :: Key -> CommandStart
start key = fieldTransfer Download key $ \_p -> do
- -- Always verify content when a direct mode repo is sending a file,
+ -- Always verify content when a repo is sending an unlocked file,
-- as the file could change while being transferred.
- fromdirect <- isJust <$> Fields.getField Fields.direct
- let verify = if fromdirect then AlwaysVerify else DefaultVerify
+ fromunlocked <- (isJust <$> Fields.getField Fields.unlocked)
+ <||> (isJust <$> Fields.getField Fields.direct)
+ let verify = if fromunlocked then AlwaysVerify else DefaultVerify
ifM (getViaTmp verify key go)
( do
-- forcibly quit after receiving one key,