summaryrefslogtreecommitdiff
path: root/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 03:18:11 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 03:18:11 -0400
commit6f3572e47f57bbe5cc76b58c8bcdc9c6c455dce0 (patch)
tree4f7f31a703051b9df3986e2a3e7dbfb146e2e032 /UUID.hs
parent0b55bd05de7b83a474ea58e9d45676934667f4bd (diff)
more reorg, spiffed up state monad
Diffstat (limited to 'UUID.hs')
-rw-r--r--UUID.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/UUID.hs b/UUID.hs
index 9c8b23a96..1c31a343f 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -20,7 +20,8 @@ import List
import System.Cmd.Utils
import System.IO
import qualified GitRepo as Git
-import AbstractTypes
+import Types
+import qualified Annex
type UUID = String
@@ -45,22 +46,22 @@ getUUID r = do
where
configured r = Git.configGet r "annex.uuid" ""
cached r = do
- g <- gitAnnex
+ g <- Annex.gitRepo
return $ Git.configGet g (configkey r) ""
configkey r = "remote." ++ (Git.repoRemoteName r) ++ ".annex-uuid"
{- Make sure that the repo has an annex.uuid setting. -}
prepUUID :: Annex ()
prepUUID = do
- g <- gitAnnex
+ g <- Annex.gitRepo
u <- getUUID g
if ("" == u)
then do
uuid <- genUUID
liftIO $ Git.run g ["config", configkey, uuid]
-- re-read git config and update the repo's state
- u' <- liftIO $ Git.configRead g
- gitAnnexChange u'
+ g' <- liftIO $ Git.configRead g
+ Annex.gitRepoChange g'
return ()
else return ()