summaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
commite78475737636a5d1e0d0a36b475c300cc7bb56cc (patch)
tree1d88de569e951b66ff5321eefaec49ad4b33bf89 /Remote.hs
parent9bb797c0eae3c9d2f119a734762a6d5fa7321a80 (diff)
hlint tweaks
Did all sources except Remotes/* and Command/*
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Remote.hs b/Remote.hs
index de1c7f38d..1a5006f6f 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -33,6 +33,7 @@ import Control.Monad (filterM, liftM2)
import Data.List
import qualified Data.Map as M
import Data.String.Utils
+import Data.Maybe
import Types
import Types.Remote
@@ -97,7 +98,7 @@ byName' "" = return $ Left "no remote specified"
byName' n = do
allremotes <- genList
let match = filter matching allremotes
- if (null match)
+ if null match
then return $ Left $ "there is no git remote named \"" ++ n ++ "\""
else return $ Right $ head match
where
@@ -110,7 +111,7 @@ nameToUUID "." = getUUID =<< Annex.gitRepo -- special case for current repo
nameToUUID n = do
res <- byName' n
case res of
- Left e -> return . (maybe (error e) id) =<< byDescription
+ Left e -> return . fromMaybe (error e) =<< byDescription
Right r -> return $ uuid r
where
byDescription = return . M.lookup n . invertMap =<< uuidMap
@@ -122,7 +123,7 @@ prettyPrintUUIDs :: [UUID] -> Annex String
prettyPrintUUIDs uuids = do
here <- getUUID =<< Annex.gitRepo
-- Show descriptions from the uuid log, falling back to remote names,
- -- as some remotes may not be in the uuid log.
+ -- as some remotes may not be in the uuid log
m <- liftM2 M.union uuidMap $
return . M.fromList . map (\r -> (uuid r, name r)) =<< genList
return $ unwords $ map (\u -> "\t" ++ prettify m u here ++ "\n") uuids