aboutsummaryrefslogtreecommitdiff
path: root/Remote/GCrypt.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-08-08 19:18:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-08-08 19:18:08 -0400
commit69e1ee3fde8530361ce4c0569f4ec2175f2d86a7 (patch)
treeb1ebfa6c35a83685b483665e6f4795eaae846432 /Remote/GCrypt.hs
parent068b5f24417681425a3b0a8b706bfe19b89922ba (diff)
fix checkPresent error handling for non-present local git repos
guardUsable r (error "foo") *returned* an error, rather than throwing it
Diffstat (limited to 'Remote/GCrypt.hs')
-rw-r--r--Remote/GCrypt.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs
index 8891977f7..5edb3d022 100644
--- a/Remote/GCrypt.hs
+++ b/Remote/GCrypt.hs
@@ -306,7 +306,7 @@ setGcryptEncryption c remotename = do
store :: Remote -> Remote.Rsync.RsyncOpts -> Storer
store r rsyncopts
| not $ Git.repoIsUrl (repo r) =
- byteStorer $ \k b p -> guardUsable (repo r) False $ liftIO $ do
+ byteStorer $ \k b p -> guardUsable (repo r) (return False) $ liftIO $ do
let tmpdir = Git.repoLocation (repo r) </> "tmp" </> keyFile k
void $ tryIO $ createDirectoryIfMissing True tmpdir
let tmpf = tmpdir </> keyFile k
@@ -323,7 +323,7 @@ store r rsyncopts
retrieve :: Remote -> Remote.Rsync.RsyncOpts -> Retriever
retrieve r rsyncopts
| not $ Git.repoIsUrl (repo r) = byteRetriever $ \k sink ->
- guardUsable (repo r) False $
+ guardUsable (repo r) (return False) $
sink =<< liftIO (L.readFile $ gCryptLocation r k)
| Git.repoIsSsh (repo r) = if isShell r
then fileRetriever $ \f k p ->
@@ -335,7 +335,7 @@ retrieve r rsyncopts
remove :: Remote -> Remote.Rsync.RsyncOpts -> Remover
remove r rsyncopts k
- | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) False $
+ | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $
liftIO $ Remote.Directory.removeDirGeneric (Git.repoLocation (repo r)) (parentDir (gCryptLocation r k))
| Git.repoIsSsh (repo r) = shellOrRsync r removeshell removersync
| otherwise = unsupportedUrl