avoid starting a download for a local transfer when the remote already has the key

Turns out that recvkey already does this same check. This avoids a transfer
file being created for the download that never happened, which in turn
will avoid the assistant seeing that the download has finished, when no
transfer actually took place.
This commit is contained in:
Joey Hess 2012-09-18 13:59:03 -04:00
parent e6d4108fad
commit e9238e9588
2 changed files with 11 additions and 9 deletions

View file

@ -269,12 +269,15 @@ copyToRemote r key file
params <- rsyncParams r
u <- getUUID
-- run copy from perspective of remote
liftIO $ onLocal r $ do
ensureInitialized
download u key file $
Annex.Content.saveState True `after`
Annex.Content.getViaTmp key
(rsyncOrCopyFile params keysrc)
liftIO $ onLocal r $ ifM (Annex.Content.inAnnex key)
( return False
, do
ensureInitialized
download u key file $
Annex.Content.saveState True `after`
Annex.Content.getViaTmp key
(rsyncOrCopyFile params keysrc)
)
| Git.repoIsSsh r = commitOnCleanup r $ do
keysrc <- inRepo $ gitAnnexLocation key
rsyncHelper =<< rsyncParamsRemote r False key keysrc file