diff options
author | Joey Hess <joey@kitenet.net> | 2014-08-10 14:52:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-08-10 15:02:59 -0400 |
commit | c88874a89db54402dbf6bdd56f6d0306f4303e53 (patch) | |
tree | 35b27c254a39b0674142b7cf313492a705e4874b /Command/Map.hs | |
parent | 425730f03a68cfa6a0e43a88c83f3470d8724627 (diff) |
testremote: Add testing of behavior when remote is not available
Added a mkUnavailable method, which a Remote can use to generate a version
of itself that is not available. Implemented for several, but not yet all
remotes.
This allows testing that checkPresent properly throws an exceptions when
it cannot check if a key is present or not. It also allows testing that the
other methods don't throw exceptions in these circumstances.
This immediately found several bugs, which this commit also fixes!
* git remotes using ssh accidentially had checkPresent return
an exception, rather than throwing it
* The chunking code accidentially returned False rather than
propigating an exception when there were no chunks and
checkPresent threw an exception for the non-chunked key.
This commit was sponsored by Carlo Matteo Capocasa.
Diffstat (limited to 'Command/Map.hs')
-rw-r--r-- | Command/Map.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Command/Map.hs b/Command/Map.hs index a62c3e1ad..b1d28113b 100644 --- a/Command/Map.hs +++ b/Command/Map.hs @@ -200,7 +200,7 @@ tryScan r where p = proc cmd $ toCommand params - configlist = Ssh.onRemote r (pipedconfig, Nothing) "configlist" [] [] + configlist = Ssh.onRemote r (pipedconfig, return Nothing) "configlist" [] [] manualconfiglist = do gc <- Annex.getRemoteGitConfig r sshparams <- Ssh.toRepo r gc [Param sshcmd] |