move several readonly values to AnnexRead
This improves performance to a small extent in several places. Sponsored-by: Tobias Ammann on Patreon
This commit is contained in:
parent
4174ee33a4
commit
cb9cf30c48
42 changed files with 81 additions and 88 deletions
|
@ -44,7 +44,7 @@ defaultBackend = maybe cache return =<< Annex.getState Annex.backend
|
|||
where
|
||||
cache = do
|
||||
n <- maybe (annexBackend <$> Annex.getGitConfig) (return . Just)
|
||||
=<< Annex.getState Annex.forcebackend
|
||||
=<< Annex.getRead Annex.forcebackend
|
||||
b <- case n of
|
||||
Just name | valid name -> lookupname name
|
||||
_ -> pure (Prelude.head builtinList)
|
||||
|
@ -79,7 +79,7 @@ unknownBackendVarietyMessage v =
|
|||
- That can be configured on a per-file basis in the gitattributes file,
|
||||
- or forced with --backend. -}
|
||||
chooseBackend :: RawFilePath -> Annex (Maybe Backend)
|
||||
chooseBackend f = Annex.getState Annex.forcebackend >>= go
|
||||
chooseBackend f = Annex.getRead Annex.forcebackend >>= go
|
||||
where
|
||||
go Nothing = maybeLookupBackendVariety . parseKeyVariety . encodeBS
|
||||
=<< checkAttr "annex.backend" f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue