summaryrefslogtreecommitdiff
path: root/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-12 13:12:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-12 13:12:47 -0400
commit4fbdb197d524720d1ea77795b33cb5d24152bce9 (patch)
tree75d6223b2747ad52184d80f7694e170492d92368 /UUID.hs
parentdc1d5e68317b85043c8c30a82f53f78b0a9a9f51 (diff)
correctness
Diffstat (limited to 'UUID.hs')
-rw-r--r--UUID.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/UUID.hs b/UUID.hs
index a0e078482..0b795b8c1 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -23,14 +23,16 @@ genUUID :: IO String
genUUID = do
pOpen ReadFromPipe "uuid" ["-m"] $ \h -> hGetLine h
+{- Looks up a repo's UUID -}
getUUID :: GitRepo -> String
getUUID repo = gitConfig repo "annex.uuid" ""
{- Make sure that the repo has an annex.uuid setting. -}
-prepUUID :: GitRepo -> IO ()
+prepUUID :: GitRepo -> IO GitRepo
prepUUID repo =
if ("" == getUUID repo)
then do
uuid <- genUUID
gitRun repo ["config", configkey, uuid]
- else return ()
+ gitConfigRead repo -- return new repo with updated config
+ else return repo