check Remote.hasKeyCheap again
authorJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2020 18:44:00 +0000 (14:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2020 18:44:00 +0000 (14:44 -0400)
commitf29d49d47804cd1b6a54ad920b4a6ab44e390886
treef8613f6d9a31ecb7531a439d84f1a9a8aa9c9bd3
parentc2a5f3c44fbd2da0d8794229f3aa94c2f5095f9d
check Remote.hasKeyCheap again

In cd1676d604, it stopped using that to avoid surprising behavior
when the location log and remote content were out of sync.
But, it seems that may have changed some behavior users relied on as
well, and also Remote.hasKeyCheap should be faster than checking then
location log.

So, try Remote.hasKeyCheap first, and only if it does not have the key,
fall back to checking the location log. If the location log still thinks
it's present, go ahead and try to get it, so the user will see a failure
rather than silently skipping a file what whereis says is on the remote.

This does make slightly slower the case where the remote does not have
the key, and location log and Remote.hasKeyCheap agree, since it now
checks both. But only 1 stat slower.
Command/Move.hs
doc/forum/What_is_going_on_here__63__/comment_6_536adad665f481a15d4096360d0106c1._comment [new file with mode: 0644]