AssociatedFile newtype
To prevent any further mistakes like 301aff34c4
This commit was sponsored by Francois Marier on Patreon.
This commit is contained in:
parent
2cd7496210
commit
c8e1e3dada
43 changed files with 179 additions and 138 deletions
|
@ -326,7 +326,8 @@ store r rsyncopts
|
|||
return True
|
||||
| Git.repoIsSsh (repo r) = if accessShell r
|
||||
then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p)
|
||||
=<< Ssh.rsyncParamsRemote False r Upload k f Nothing
|
||||
=<< Ssh.rsyncParamsRemote False r Upload k f
|
||||
(AssociatedFile Nothing)
|
||||
else fileStorer $ Remote.Rsync.store rsyncopts
|
||||
| otherwise = unsupportedUrl
|
||||
|
||||
|
@ -336,8 +337,10 @@ retrieve r rsyncopts
|
|||
guardUsable (repo r) (return False) $
|
||||
sink =<< liftIO (L.readFile $ gCryptLocation r k)
|
||||
| Git.repoIsSsh (repo r) = if accessShell r
|
||||
then fileRetriever $ \f k p ->
|
||||
unlessM (Ssh.rsyncHelper (Just p) =<< Ssh.rsyncParamsRemote False r Download k f Nothing) $
|
||||
then fileRetriever $ \f k p -> do
|
||||
ps <- Ssh.rsyncParamsRemote False r Download k f
|
||||
(AssociatedFile Nothing)
|
||||
unlessM (Ssh.rsyncHelper (Just p) ps) $
|
||||
giveup "rsync failed"
|
||||
else fileRetriever $ Remote.Rsync.retrieve rsyncopts
|
||||
| otherwise = unsupportedUrl
|
||||
|
|
|
@ -479,8 +479,9 @@ copyFromRemote' r key file dest meterupdate
|
|||
)
|
||||
feedprogressback' a = do
|
||||
u <- getUUID
|
||||
let AssociatedFile afile = file
|
||||
let fields = (Fields.remoteUUID, fromUUID u)
|
||||
: maybe [] (\f -> [(Fields.associatedFile, f)]) file
|
||||
: maybe [] (\f -> [(Fields.associatedFile, f)]) afile
|
||||
Just (cmd, params) <- Ssh.git_annex_shell ConsumeStdin
|
||||
(repo r) "transferinfo"
|
||||
[Param $ key2file key] fields
|
||||
|
|
|
@ -126,7 +126,7 @@ rsyncHelper m params = do
|
|||
{- Generates rsync parameters that ssh to the remote and asks it
|
||||
- to either receive or send the key's content. -}
|
||||
rsyncParamsRemote :: Bool -> Remote -> Direction -> Key -> FilePath -> AssociatedFile -> Annex [CommandParam]
|
||||
rsyncParamsRemote unlocked r direction key file afile = do
|
||||
rsyncParamsRemote unlocked r direction key file (AssociatedFile afile) = do
|
||||
u <- getUUID
|
||||
let fields = (Fields.remoteUUID, fromUUID u)
|
||||
: (Fields.unlocked, if unlocked then "1" else "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue