summaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-12-28 17:17:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-12-28 17:17:02 -0400
commitaa4f91b2d67b9f7827b02acebfbf4e67ba33bb80 (patch)
treeb81d1dea5915cc6aad1b9d0efc911fc1b9bbbe9a /Remotes.hs
parent6c58a58393a1d6d2257cb9e72e534387561943d7 (diff)
Add trust and untrust subcommands, to allow configuring remotes that are trusted to retain files without explicit checking.
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Remotes.hs b/Remotes.hs
index cf49b624b..725348a6a 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -12,6 +12,7 @@ module Remotes (
inAnnex,
same,
commandLineRemote,
+ byName,
copyFromRemote,
copyToRemote,
runCmd
@@ -156,6 +157,11 @@ commandLineRemote = do
fromName <- Annex.flagGet "fromrepository"
toName <- Annex.flagGet "torepository"
let name = if null fromName then toName else fromName
+ byName name
+
+{- Looks up a remote by name. -}
+byName :: String -> Annex Git.Repo
+byName name = do
when (null name) $ error "no remote specified"
g <- Annex.gitRepo
let match = filter (\r -> name == Git.repoRemoteName r) $