From 8ef2095fa00408ce6729596a42bc0abdc7778098 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 Oct 2011 22:24:57 -0400 Subject: factor out common imports no code changes --- Config.hs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'Config.hs') diff --git a/Config.hs b/Config.hs index fe847fce1..c0328794e 100644 --- a/Config.hs +++ b/Config.hs @@ -7,23 +7,16 @@ module Config where -import Data.Maybe -import Control.Monad.State (liftIO) -import Control.Applicative -import System.Cmd.Utils - +import AnnexCommon import qualified Git import qualified Annex -import Types -import Utility -import Utility.SafeCommand type ConfigKey = String {- Changes a git config setting in both internal state and .git/config -} setConfig :: ConfigKey -> String -> Annex () setConfig k value = do - g <- Annex.gitRepo + g <- gitRepo liftIO $ Git.run g "config" [Param k, Param value] -- re-read git config and update the repo's state g' <- liftIO $ Git.configRead g @@ -33,7 +26,7 @@ setConfig k value = do - Failing that, tries looking for a global config option. -} getConfig :: Git.Repo -> ConfigKey -> String -> Annex String getConfig r key def = do - g <- Annex.gitRepo + g <- gitRepo let def' = Git.configGet g ("annex." ++ key) def return $ Git.configGet g (remoteConfig r key) def' @@ -95,7 +88,7 @@ getNumCopies v = where use (Just n) = return n use Nothing = do - g <- Annex.gitRepo + g <- gitRepo return $ read $ Git.configGet g config "1" config = "annex.numcopies" -- cgit v1.2.3