From bf4c44daf628a980666cc86fabae9522375d09e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Jan 2013 11:45:44 -0400 Subject: check for direct mode file change when copying to a local git remote --- Remote/Git.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Remote') diff --git a/Remote/Git.hs b/Remote/Git.hs index a5718e328..2ece2fb8e 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -331,13 +331,15 @@ copyFromRemoteCheap r key file copyToRemote :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool copyToRemote r key file p | not $ Git.repoIsUrl (repo r) = - guardUsable (repo r) False $ commitOnCleanup r $ copylocal + guardUsable (repo r) False $ commitOnCleanup r $ + copylocal =<< Annex.Content.prepSendAnnex key | Git.repoIsSsh (repo r) = commitOnCleanup r $ Annex.Content.sendAnnex key noop $ \object -> rsyncHelper (Just p) =<< rsyncParamsRemote r False key object file | otherwise = error "copying to non-ssh repo not supported" where - copylocal = Annex.Content.sendAnnex key noop $ \object -> do + copylocal Nothing = return False + copylocal (Just (object, checksuccess)) = do let params = rsyncParams r u <- getUUID -- run copy from perspective of remote @@ -347,7 +349,7 @@ copyToRemote r key file p ensureInitialized download u key file noRetry $ Annex.Content.saveState True `after` - Annex.Content.getViaTmp key + Annex.Content.getViaTmpChecked checksuccess key (\d -> rsyncOrCopyFile params object d p) ) -- cgit v1.2.3