summaryrefslogtreecommitdiff
path: root/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-09 15:05:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-09 15:05:08 -0400
commit75d29250823326c8b4894a855927f65b5fdf4e13 (patch)
treea888b86d8e0569b9e1c388700dd6717aaa175834 /UUID.hs
parent377bf24d9a951186b374cd7a3f920b6bc9deb8f1 (diff)
parent8d5374f4a33f398baa166035e5fafb716a78fd1d (diff)
Merge branch 'master' into checkout
Conflicts: debian/changelog doc/backends.mdwn
Diffstat (limited to 'UUID.hs')
-rw-r--r--UUID.hs13
1 files changed, 2 insertions, 11 deletions
diff --git a/UUID.hs b/UUID.hs
index ffd2cd46d..0f8a2173e 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -65,7 +65,7 @@ getUUID r = do
where
uncached = Git.configGet r "annex.uuid" ""
cached g = Git.configGet g cachekey ""
- updatecache g u = when (g /= r) $ setConfig cachekey u
+ updatecache g u = when (g /= r) $ Annex.setConfig cachekey u
cachekey = "remote." ++ (Git.repoRemoteName r) ++ ".annex-uuid"
{- Make sure that the repo has an annex.uuid setting. -}
@@ -75,16 +75,7 @@ prepUUID = do
u <- getUUID g
when ("" == u) $ do
uuid <- liftIO $ genUUID
- setConfig configkey uuid
-
-{- 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'
+ Annex.setConfig configkey uuid
{- Filters a list of repos to ones that have listed UUIDs. -}
reposByUUID :: [Git.Repo] -> [UUID] -> Annex [Git.Repo]