summaryrefslogtreecommitdiff
path: root/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-15 15:27:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-15 15:27:49 -0400
commit6aab88fa251a14fbf31c7a8d80296c78db0ed048 (patch)
tree34465a5c706ab825ecd34b9261ecc6f35e4dd555 /UUID.hs
parent1e5beda86a1d0185466547bd1acb61a75ac66992 (diff)
more monadic operator use
Diffstat (limited to 'UUID.hs')
-rw-r--r--UUID.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/UUID.hs b/UUID.hs
index eb1fb319c..0d7aee141 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -79,8 +79,7 @@ getUncachedUUID r = Git.configGet r configkey ""
{- Make sure that the repo has an annex.uuid setting. -}
prepUUID :: Annex ()
prepUUID = do
- g <- Annex.gitRepo
- u <- getUUID g
+ u <- getUUID =<< Annex.gitRepo
when ("" == u) $ do
uuid <- liftIO $ genUUID
setConfig configkey uuid
@@ -88,8 +87,7 @@ prepUUID = do
{- Pretty-prints a list of UUIDs -}
prettyPrintUUIDs :: [UUID] -> Annex String
prettyPrintUUIDs uuids = do
- g <- Annex.gitRepo
- here <- getUUID g
+ here <- getUUID =<< Annex.gitRepo
m <- uuidMap
return $ unwords $ map (\u -> "\t" ++ prettify m u here ++ "\n") uuids
where