From 03e54680ff1432915e2e02f87c95a9126af5a420 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 30 Sep 2011 02:51:05 -0400 Subject: really fix referring to remotes by uuid --- Remote.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Remote.hs b/Remote.hs index 05f70a5d7..87fd8aab6 100644 --- a/Remote.hs +++ b/Remote.hs @@ -119,11 +119,12 @@ nameToUUID n = do where byDescription = do m <- uuidMap - case M.lookup n $ invertMap m of + case M.lookup n $ transform swap m of Just u -> return $ Just u - Nothing -> return $ M.lookup n m - invertMap = M.fromList . map swap . M.toList + Nothing -> return $ M.lookup n $ transform double m + transform a = M.fromList . map a . M.toList swap (a, b) = (b, a) + double (a, _) = (a, a) {- Pretty-prints a list of UUIDs of remotes, for human display. - -- cgit v1.2.3