optimiation

avoids reading the config of a local remote twice in a row
This commit is contained in:
Joey Hess 2011-12-12 02:24:37 -04:00
parent 2332afb4bc
commit c7e65bbb12

View file

@ -86,9 +86,9 @@ tryGitConfigRead r
| Git.repoIsSsh r = store $ onRemote r (pipedconfig, r) "configlist" []
| Git.repoIsHttp r = store $ safely geturlconfig
| Git.repoIsUrl r = return r
| otherwise = store $ safely $ do
onLocal r ensureInitialized
Git.configRead r
| otherwise = store $ safely $ onLocal r $ do
ensureInitialized
Annex.getState Annex.repo
where
-- Reading config can fail due to IO error or
-- for other reasons; catch all possible exceptions.