- Note: Be sure to add the config to mergeGitConfig and to
- globalConfigs.
-}
-getGitConfigVal :: (GitConfig -> Configurable a) -> Annex a
+getGitConfigVal :: (GitConfig -> GlobalConfigurable a) -> Annex a
getGitConfigVal f = getGitConfigVal' f >>= \case
HasGlobalConfig c -> return c
DefaultConfig d -> return d
HasGitConfig c -> return c
-getGitConfigVal' :: (GitConfig -> Configurable a) -> Annex (Configurable a)
+getGitConfigVal' :: (GitConfig -> GlobalConfigurable a) -> Annex (GlobalConfigurable a)
getGitConfigVal' f = (f <$> Annex.getGitConfig) >>= \case
DefaultConfig _ -> do
r <- Annex.gitRepo
{-# LANGUAGE OverloadedStrings #-}
module Types.GitConfig (
- Configurable(..),
+ GlobalConfigurable(..),
ConfigSource(..),
GitConfig(..),
extractGitConfig,
-- | A configurable value, that may not be fully determined yet because
-- the global git config has not yet been loaded.
-data Configurable a
+data GlobalConfigurable a
= HasGitConfig a
-- ^ The git config has a value.
| HasGlobalConfig a
, annexDelayAdd :: Maybe Int
, annexHttpHeaders :: [String]
, annexHttpHeadersCommand :: Maybe String
- , annexAutoCommit :: Configurable Bool
- , annexResolveMerge :: Configurable Bool
- , annexSyncContent :: Configurable Bool
- , annexSyncOnlyAnnex :: Configurable Bool
+ , annexAutoCommit :: GlobalConfigurable Bool
+ , annexResolveMerge :: GlobalConfigurable Bool
+ , annexSyncContent :: GlobalConfigurable Bool
+ , annexSyncOnlyAnnex :: GlobalConfigurable Bool
, annexDebug :: Bool
, annexWebOptions :: [String]
, annexYoutubeDlOptions :: [String]
, annexAriaTorrentOptions :: [String]
, annexCrippledFileSystem :: Bool
- , annexLargeFiles :: Configurable (Maybe String)
- , annexDotFiles :: Configurable Bool
+ , annexLargeFiles :: GlobalConfigurable (Maybe String)
+ , annexDotFiles :: GlobalConfigurable Bool
, annexGitAddToAnnex :: Bool
, annexAddSmallFiles :: Bool
, annexFsckNudge :: Bool
, annexVerify :: Bool
, annexPidLock :: Bool
, annexPidLockTimeout :: Seconds
- , annexAddUnlocked :: Configurable (Maybe String)
+ , annexAddUnlocked :: GlobalConfigurable (Maybe String)
, annexSecureHashesOnly :: Bool
, annexRetry :: Maybe Integer
, annexForwardRetry :: Maybe Integer