From 954898841c332833dd1b2e40d745fd5ce4caf41d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Jun 2017 12:57:27 -0400 Subject: Avoid error about git-annex-shell not being found when syncing with -J with a git remote where git-annex-shell is not installed. This commit was sponsored by andrea rota. --- Annex/Ssh.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Annex') diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 50a516342..4e6cc6a59 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -193,8 +193,10 @@ prepSocket socketfile gc sshparams = do c <- Annex.getState Annex.concurrency case c of - Concurrent {} -> makeconnection socketlock - NonConcurrent -> return () + Concurrent {} + | annexUUID (remoteGitConfig gc) /= NoUUID -> + makeconnection socketlock + _ -> return () lockFileCached socketlock where @@ -207,11 +209,15 @@ prepSocket socketfile gc sshparams = do -- When we can start the connection in batch mode, -- ssh won't prompt to the console. (_, connected) <- liftIO $ processTranscript "ssh" - (["-o", "BatchMode=true"] ++ toCommand startps) + (["-o", "BatchMode=true"] + ++ toCommand startps) Nothing - unless connected $ - prompt $ void $ liftIO $ + unless connected $ do + ok <- prompt $ liftIO $ boolSystem "ssh" startps + unless ok $ + warning $ "Unable to run git-annex-shell on remote " ++ + Git.repoDescribe (gitConfigRepo (remoteGitConfig gc)) -- Parameters to get ssh connected to the remote host, -- by asking it to run a no-op command. -- cgit v1.2.3