summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-02 15:41:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-02 15:41:20 -0400
commit7a3aafe76274a9e54395acb8ec2ce351888495de (patch)
treeae6a865351bc5ead9139b209ad7606b26ad73a34 /Command
parent1218c7b96704ecf0b4564d19bab2d04f7e539070 (diff)
copy --from, get --from: When --force is used, ignore the location log and always try to get the file from the remote.
Diffstat (limited to 'Command')
-rw-r--r--Command/Move.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index dc501ae0f..7d11b5abd 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -133,11 +133,14 @@ fromStart src move afile key
next $ fromPerform src move key afile
fromOk :: Remote -> Key -> Annex Bool
-fromOk src key
- | Remote.hasKeyCheap src =
- either (const expensive) return =<< Remote.hasKey src key
- | otherwise = expensive
+fromOk src key = go =<< Annex.getState Annex.force
where
+ go True = either (const $ return True) return =<< haskey
+ go False
+ | Remote.hasKeyCheap src =
+ either (const expensive) return =<< haskey
+ | otherwise = expensive
+ haskey = Remote.hasKey src key
expensive = do
u <- getUUID
remotes <- Remote.keyPossibilities key