diff options
Diffstat (limited to 'Annex/UUID.hs')
-rw-r--r-- | Annex/UUID.hs | 14 |
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 |