sped up git-annex smudge --clean by 25%

Disabling git-annex branch update for this command is
ok, because it does not use any information from the branch,
but only logs the location when it adds a key.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2021-09-24 14:15:20 -04:00
parent e47b4badb3
commit 9ea8106bb0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 17 additions and 2 deletions

View file

@ -30,6 +30,7 @@ import Annex.InodeSentinal
import Utility.InodeCache
import Config.GitConfig
import qualified Types.Backend
import qualified Annex.BranchState
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
@ -87,6 +88,7 @@ smudge file = do
-- injested content if so. Otherwise, the original content.
clean :: RawFilePath -> CommandStart
clean file = do
Annex.BranchState.disableUpdate -- optimisation
b <- liftIO $ L.hGetContents stdin
ifM fileoutsiderepo
( liftIO $ L.hPut stdout b