diff --git a/Command/Move.hs b/Command/Move.hs index 71e2951700..584565648a 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -207,10 +207,22 @@ fromStart removewhen afile key ai si src = fromPerform src removewhen key afile fromOk :: Remote -> Key -> Annex Bool -fromOk src key = do - u <- getUUID - remotes <- Remote.keyPossibilities key - return $ u /= Remote.uuid src && elem src remotes +fromOk src key + -- check if the remote contains the key, when it can be done cheaply + | Remote.hasKeyCheap src = + Remote.hasKey src key >>= + Right True -> return True + -- Don't skip getting the key just because the + -- remote no longer contains it if the log + -- says the remote is supposed to contain it; + -- that would be surprising behavior. + _ -> checklog + | otherwise = checklog + where + checklog = do + u <- getUUID + remotes <- Remote.keyPossibilities key + return $ u /= Remote.uuid src && elem src remotes fromPerform :: Remote -> RemoveWhen -> Key -> AssociatedFile -> CommandPerform fromPerform src removewhen key afile = do diff --git a/doc/forum/What_is_going_on_here__63__/comment_6_536adad665f481a15d4096360d0106c1._comment b/doc/forum/What_is_going_on_here__63__/comment_6_536adad665f481a15d4096360d0106c1._comment new file mode 100644 index 0000000000..6c209adf4f --- /dev/null +++ b/doc/forum/What_is_going_on_here__63__/comment_6_536adad665f481a15d4096360d0106c1._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 6""" + date="2020-12-15T18:42:30Z" + content=""" +On second thought, it can check as before and only +if the remote doesn't have the key, fall back to using information from the +log. That will be faster, and will avoid changing the behavior you were +relying on. Implemented that. +"""]]