fix checkPresent error handling for non-present local git repos

guardUsable r (error "foo") *returned* an error, rather than throwing it
This commit is contained in:
Joey Hess 2014-08-08 19:18:08 -04:00
parent 1dd3232e8e
commit 4f1ba9a23d
3 changed files with 18 additions and 17 deletions

View file

@ -26,7 +26,7 @@ availabilityCalc r
{- Avoids performing an action on a local repository that's not usable.
- Does not check that the repository is still available on disk. -}
guardUsable :: Git.Repo -> a -> Annex a -> Annex a
guardUsable r onerr a
| Git.repoIsLocalUnknown r = return onerr
guardUsable :: Git.Repo -> Annex a -> Annex a -> Annex a
guardUsable r fallback a
| Git.repoIsLocalUnknown r = fallback
| otherwise = a