assistant: Make expensive transfer scan work fully in direct mode.

The expensive scan uses lookupFile, but in direct mode, that doesn't work
for files that are present. So the scan was not finding things that are
present that need to be uploaded. (It did find things not present that
needed to be downloaded.)

Now lookupFile also works in direct mode. Note that it still prefers
symlinks on disk to info committed to git, in direct mode. This is
necessary to make things like Assistant.Threads.Watcher.onAddSymlink
work correctly, when given a new symlink not yet checked into git (or
replacing a file checked into git).
This commit is contained in:
Joey Hess 2013-01-05 15:26:22 -04:00
parent 15ecce2bfd
commit 1cdf2b923d
5 changed files with 38 additions and 11 deletions

View file

@ -138,7 +138,7 @@ onAdd file filestatus
- really been modified. -}
onAddDirect :: Handler
onAddDirect file fs = do
v <- liftAnnex $ catKey (Ref $ ':':file)
v <- liftAnnex $ catKeyFile file
case (v, fs) of
(Just key, Just filestatus) ->
ifM (liftAnnex $ changedFileStatus key filestatus)