summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-18 13:59:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-18 13:59:03 -0400
commite9238e958877dff9d12a5a0ed396e93931de95ce (patch)
treeb6bcec28853270ec2d6624754bfa219c462e70c1 /Remote
parente6d4108fadcabf630e90012bab83107eaba040f2 (diff)
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.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 49f040cc8..06e9ef1eb 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -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