aboutsummaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-09 23:31:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-09 23:31:44 -0400
commit0d5c4022105a393a4eac76b09940f8b22fa0a56c (patch)
treea86e5d64d4b9fc95b0316c5fb08b9eef925bd1b7 /Git/Config.hs
parent9ffd97442b3f2e4e9de6895d843aee382ad10dfd (diff)
Add annex-trustlevel configuration settings, which can be used to override the trust level of a remote.
This overrides the trust.log, and is overridden by the command-line trust parameters. It would have been nicer to have Logs.Trust.trustMap just look up the configuration for all remotes, but a dependency loop prevented that (Remotes depends on Logs.Trust in several ways). So instead, look up the configuration when building remotes, storing it in the same forcetrust field used for the command-line trust parameters.
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index d9109548b..55ab8a6f1 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -20,6 +20,10 @@ import qualified Git.Construct
get :: String -> String -> Repo -> String
get key defaultValue repo = M.findWithDefault defaultValue key (config repo)
+{- Returns a single git config setting, if set. -}
+getMaybe :: String -> Repo -> Maybe String
+getMaybe key repo = M.lookup key (config repo)
+
{- Runs git config and populates a repo with its config. -}
read :: Repo -> IO Repo
read repo@(Repo { location = Dir d }) = do