aboutsummaryrefslogtreecommitdiff
path: root/Annex/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-05-05 20:15:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-05-05 20:16:56 -0400
commitf7d8982672fd330a466c2cb22f34388e7cc429c0 (patch)
treeb5739058cc2cb04fa4a119df2cecf449d4846c03 /Annex/UUID.hs
parent657d09d49990af85c1a91b1154a195a30438477c (diff)
Fix use of several config settings
annex.ssh-options, annex.rsync-options, annex.bup-split-options. And adjust types to avoid the bugs that broke several config settings recently. Now "annex." prefixing is enforced at the type level.
Diffstat (limited to 'Annex/UUID.hs')
-rw-r--r--Annex/UUID.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Annex/UUID.hs b/Annex/UUID.hs
index 5459cc7fe..517840fba 100644
--- a/Annex/UUID.hs
+++ b/Annex/UUID.hs
@@ -23,12 +23,11 @@ module Annex.UUID (
import Common.Annex
import qualified Git
import qualified Git.Config
-import qualified Git.Command
import qualified Build.SysConfig as SysConfig
import Config
-configkey :: String
-configkey = "annex.uuid"
+configkey :: ConfigKey
+configkey = annexConfig "uuid"
{- Generates a UUID. There is a library for this, but it's not packaged,
- so use the command line tool. -}
@@ -64,16 +63,17 @@ getRepoUUID r = do
cachekey = remoteConfig r "uuid"
removeRepoUUID :: Annex ()
-removeRepoUUID = inRepo $ Git.Command.run "config"
- [Param "--unset", Param configkey]
+removeRepoUUID = unsetConfig configkey
getUncachedUUID :: Git.Repo -> UUID
-getUncachedUUID = toUUID . Git.Config.get configkey ""
+getUncachedUUID = toUUID . Git.Config.get key ""
+ where
+ (ConfigKey key) = configkey
{- Make sure that the repo has an annex.uuid setting. -}
prepUUID :: Annex ()
prepUUID = whenM ((==) NoUUID <$> getUUID) $
storeUUID configkey =<< liftIO genUUID
-storeUUID :: String -> UUID -> Annex ()
+storeUUID :: ConfigKey -> UUID -> Annex ()
storeUUID configfield = setConfig configfield . fromUUID