fromRepo,
calcRepo,
getGitConfig,
- changeGitConfig,
+ overrideGitConfig,
changeGitRepo,
adjustGitRepo,
getRemoteGitConfig,
getGitConfig :: Annex GitConfig
getGitConfig = getState gitconfig
-{- Modifies a GitConfig setting. The modification persists across
+{- Overrides a GitConfig setting. The modification persists across
- reloads of the repo's config. -}
-changeGitConfig :: (GitConfig -> GitConfig) -> Annex ()
-changeGitConfig f = changeState $ \s -> s
+overrideGitConfig :: (GitConfig -> GitConfig) -> Annex ()
+overrideGitConfig f = changeState $ \s -> s
{ gitconfigadjustment = gitconfigadjustment s . f
, gitconfig = f (gitconfig s)
}
storeUUID =<< liftIO genUUID
storeUUID :: UUID -> Annex ()
-storeUUID u = do
- Annex.changeGitConfig $ \c -> c { annexUUID = u }
- storeUUIDIn configkeyUUID u
+storeUUID = storeUUIDIn configkeyUUID
storeUUIDIn :: ConfigKey -> UUID -> Annex ()
storeUUIDIn configfield = setConfig configfield . fromUUID
setforce v = Annex.changeState $ \s -> s { Annex.force = v }
setfast v = Annex.changeState $ \s -> s { Annex.fast = v }
setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v }
- setdebug = Annex.changeGitConfig $ \c -> c { annexDebug = True }
- unsetdebug = Annex.changeGitConfig $ \c -> c { annexDebug = False }
+ setdebug = Annex.overrideGitConfig $ \c -> c { annexDebug = True }
+ unsetdebug = Annex.overrideGitConfig $ \c -> c { annexDebug = False }
crippledFileSystem = annexCrippledFileSystem <$> Annex.getGitConfig
setCrippledFileSystem :: Bool -> Annex ()
-setCrippledFileSystem b = do
+setCrippledFileSystem b =
setConfig (annexConfig "crippledfilesystem") (Git.Config.boolConfig b)
- Annex.changeGitConfig $ \c -> c { annexCrippledFileSystem = b }
yesNo :: String -> Maybe Bool
yesNo "yes" = Just True
-- config makes all repository-global default
-- values populate the GitConfig with HasGlobalConfig
-- values, so it will only need to be done once.
- Annex.changeGitConfig (\gc -> mergeGitConfig gc globalgc)
+ Annex.overrideGitConfig (\gc -> mergeGitConfig gc globalgc)
f <$> Annex.getGitConfig
c -> return c
module Upgrade.V5 where
import Annex.Common
-import qualified Annex
import Config
import Config.Smudge
import Annex.InodeSentinal
- space, with less preservation of old versions of files
- as does annex.thin. -}
setConfig (annexConfig "thin") (boolConfig True)
- Annex.changeGitConfig $ \c -> c { annexThin = True }
Direct.setIndirect
cur <- fromMaybe (error "Somehow no branch is checked out")
<$> inRepo Git.Branch.current
) where
import Annex.Common
-import qualified Annex
import qualified Git
import qualified Git.Config
import qualified Git.Ref
setbare
switchHEADBack
setConfig (annexConfig "direct") val
- Annex.changeGitConfig $ \c -> c { annexDirect = False }
where
val = Git.Config.boolConfig False
coreworktree = ConfigKey "core.worktree"