summaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-28 14:20:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-28 14:20:02 -0400
commit694a33e91b290373649594688ad880203d140dcb (patch)
treeb2277f0a1db9f246a9bc0e3f8773673c908b27c0 /Remotes.hs
parentecfbc01ff8b55d4cbe02c02c604264a627e759bf (diff)
syntax tweaks
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/Remotes.hs b/Remotes.hs
index 02d4dc9c2..a432e1b5d 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -153,15 +153,13 @@ commandLineRemote = do
fromName <- Annex.flagGet "fromrepository"
toName <- Annex.flagGet "torepository"
let name = if (not $ null fromName) then fromName else toName
- if (null name)
- then error "no remote specified"
- else do
- g <- Annex.gitRepo
- let match = filter (\r -> name == Git.repoRemoteName r) $
- Git.remotes g
- if (null match)
- then error $ "there is no git remote named \"" ++ name ++ "\""
- else return $ match !! 0
+ when (null name) $ error "no remote specified"
+ g <- Annex.gitRepo
+ let match = filter (\r -> name == Git.repoRemoteName r) $
+ Git.remotes g
+ when (null match) $ error $
+ "there is no git remote named \"" ++ name ++ "\""
+ return $ match !! 0
{- The git configs for the git repo's remotes is not read on startup
- because reading it may be expensive. This function tries to read the
@@ -187,7 +185,7 @@ tryGitConfigRead r = do
where
exchange [] new = []
exchange (old:ls) new =
- if ((Git.repoRemoteName old) == (Git.repoRemoteName new))
+ if (Git.repoRemoteName old == Git.repoRemoteName new)
then new:(exchange ls new)
else old:(exchange ls new)