summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-05-13 13:13:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-05-13 13:13:13 -0400
commit23f83c876b0644b24e46f8cc1a782e2f558bf329 (patch)
tree8efdf98a48d84ce918fb562b65620d02f37b7acb /Annex
parent6c6ac101616360df129770cfe7541dd7d78b2947 (diff)
also serialize ssh password prompting when json or quiet output is enable
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Ssh.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index e0cc4a0fe..c53802941 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -34,7 +34,7 @@ import Annex.Path
import Utility.Env
import Utility.FileSystemEncoding
import Types.CleanupActions
-import Types.Messages
+import Types.Concurrency
import Git.Env
import Git.Ssh
#ifndef mingw32_HOST_OS
@@ -191,13 +191,16 @@ prepSocket socketfile gc sshparams = do
liftIO $ createDirectoryIfMissing True $ parentDir socketfile
let socketlock = socket2lock socketfile
- prompt $ \s -> when (concurrentOutputEnabled s) $ do
- -- If the LockCache already has the socketlock in it,
- -- the connection has already been started. Otherwise,
- -- get the connection started now.
- whenM (isNothing <$> fromLockCache socketlock) $
- void $ liftIO $ boolSystem "ssh" $
- sshparams ++ startSshConnection gc
+ prompt $ \c -> case c of
+ Concurrent {} -> do
+ -- If the LockCache already has the socketlock in it,
+ -- the connection has already been started. Otherwise,
+ -- get the connection started now.
+ whenM (isNothing <$> fromLockCache socketlock) $
+ void $ liftIO $ boolSystem "ssh" $
+ sshparams ++ startSshConnection gc
+ NonConcurrent -> return ()
+
lockFileCached socketlock
-- Parameters to get ssh connected to the remote host,