copy --from, get --from: When --force is used, ignore the location log and always try to get the file from the remote.

This commit is contained in:
Joey Hess 2013-12-02 15:41:20 -04:00
parent bc786b6f06
commit 66285ca3d1
3 changed files with 14 additions and 5 deletions

View file

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