look up --to and --from remote names only once

This will speed up commands like move and drop.
This commit is contained in:
Joey Hess 2012-01-06 04:02:35 -04:00
parent 0a36f92a31
commit df21cbfdd2
10 changed files with 30 additions and 33 deletions

View file

@ -61,7 +61,7 @@ syncRemotes rs = do
wanted
| null rs = good =<< available
| otherwise = listed
listed = mapM Remote.byName rs
listed = catMaybes <$> mapM (Remote.byName . Just) rs
available = filter nonspecial <$> Remote.enabledRemoteList
good = filterM $ Remote.Git.repoAvail . Types.Remote.repo
nonspecial r = Types.Remote.remotetype r == Remote.Git.remote