aboutsummaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Remote.hs b/Remote.hs
index 29097f77d..5ee75823f 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -56,6 +56,7 @@ import Data.Ord
import Common.Annex
import Types.Remote
import qualified Annex
+import Annex.Exception
import Annex.UUID
import Logs.UUID
import Logs.Trust
@@ -312,3 +313,10 @@ isXMPPRemote :: Remote -> Bool
isXMPPRemote remote = Git.repoIsUrl r && "xmpp::" `isPrefixOf` Git.repoLocation r
where
r = repo remote
+
+hasKey :: Remote -> Key -> Annex (Either String Bool)
+hasKey r k = either (Left . show) Right
+ <$> tryNonAsyncAnnex (checkPresent r k)
+
+hasKeyCheap :: Remote -> Bool
+hasKeyCheap = checkPresentCheap