aboutsummaryrefslogtreecommitdiff
path: root/Remote/Bup.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-03-17 16:02:47 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-03-17 16:20:37 -0400
commit3286bebf998700d79ab766472cebfcc4399c8894 (patch)
treed2e9270d407c291621042fe5d70b75561b96ec9a /Remote/Bup.hs
parentacc7effc35e2552809df830c4a8213771168c724 (diff)
Support GIT_SSH and GIT_SSH_COMMAND
They are handled close the same as they are by git. However, unlike git, git-annex sometimes needs to pass the -n parameter when using these. So, this has the potential for breaking some setup, and perhaps there ought to be a ANNEX_USE_GIT_SSH=1 needed to use these. But I'd rather avoid that if possible, so let's see if anyone complains. Almost all places where "ssh" was run have been changed to support the env vars. Anything still calling sshOptions does not support them. In particular, rsync special remotes don't. Seems that annex-rsync-transport already gives sufficient control there. (Fixed in passing: Remote.Helper.Ssh.toRepo used to extract remoteAnnexSshOptions and pass them to sshOptions, which was redundant since sshOptions also extracts those.) This commit was sponsored by Jeff Goeke-Smith on Patreon.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r--Remote/Bup.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index 5594bac9f..3a2d67bc8 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -212,11 +212,11 @@ storeBupUUID u buprepo = do
v = fromUUID u
onBupRemote :: Git.Repo -> (FilePath -> [CommandParam] -> IO a) -> FilePath -> [CommandParam] -> Annex a
-onBupRemote r a command params = do
+onBupRemote r runner command params = do
c <- Annex.getRemoteGitConfig r
- sshparams <- Ssh.toRepo NoConsumeStdin r c [Param $
- "cd " ++ dir ++ " && " ++ unwords (command : toCommand params)]
- liftIO $ a "ssh" sshparams
+ let remotecmd = "cd " ++ dir ++ " && " ++ unwords (command : toCommand params)
+ (sshcmd, sshparams) <- Ssh.toRepo NoConsumeStdin r c remotecmd
+ liftIO $ runner sshcmd sshparams
where
path = Git.repoPath r
base = fromMaybe path (stripPrefix "/~/" path)