summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-08 14:39:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-08 14:39:12 -0400
commitab4de454914954676aa1e05ef26dc8a85bd8f6f1 (patch)
tree17cd1334f17bb15df3d1a1d889e4f99887de9843 /Annex.hs
parentf03adec793d378cc4807392400d09e70e293a991 (diff)
Add annex.version, which will be used to automate upgrades.
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Annex.hs b/Annex.hs
index e86e1967e..7c046b141 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -19,7 +19,8 @@ module Annex (
flagGet,
Flag(..),
queue,
- queueGet
+ queueGet,
+ setConfig
) where
import Control.Monad.State
@@ -118,3 +119,12 @@ queueGet :: Annex GitQueue.Queue
queueGet = do
state <- get
return (Internals.repoqueue state)
+
+{- Changes a git config setting in both internal state and .git/config -}
+setConfig :: String -> String -> Annex ()
+setConfig key value = do
+ g <- Annex.gitRepo
+ liftIO $ Git.run g ["config", key, value]
+ -- re-read git config and update the repo's state
+ g' <- liftIO $ Git.configRead g Nothing
+ Annex.gitRepoChange g'