From c7e65bbb12db3db314d809e0186db0905c677d2f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Dec 2011 02:24:37 -0400 Subject: [PATCH] optimiation avoids reading the config of a local remote twice in a row --- Remote/Git.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Remote/Git.hs b/Remote/Git.hs index 05743a28d5..0251da5583 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -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.