avoid using cat-file --buffer if git is too old
This is only needed for the i386ancient build, so build in the git version git-annex is built with, assuming git won't be upgraded, or if it is, they just won't get the speedup of --buffer
This commit is contained in:
parent
360dc386e7
commit
8cd0e351ba
1 changed files with 9 additions and 4 deletions
|
@ -51,6 +51,7 @@ import Git.FilePath
|
|||
import Git.HashObject
|
||||
import qualified Git.LsTree as LsTree
|
||||
import qualified Utility.CoProcess as CoProcess
|
||||
import qualified Git.BuildVersion as BuildVersion
|
||||
import Utility.Tuple
|
||||
|
||||
data CatFileHandle = CatFileHandle
|
||||
|
@ -381,10 +382,14 @@ withCatFileStream
|
|||
withCatFileStream check repo reader = assertLocal repo $
|
||||
bracketIO start stop $ \(c, hin, hout, _) -> reader c hin hout
|
||||
where
|
||||
params =
|
||||
[ Param "cat-file"
|
||||
, Param ("--batch" ++ (if check then "-check" else "") ++ "=" ++ batchFormat)
|
||||
, Param "--buffer"
|
||||
params = catMaybes
|
||||
[ Just $ Param "cat-file"
|
||||
, Just $ Param ("--batch" ++ (if check then "-check" else "") ++ "=" ++ batchFormat)
|
||||
-- This option makes it faster, but is not present in
|
||||
-- older versions of git.
|
||||
, if BuildVersion.older "2.4.3"
|
||||
then Nothing
|
||||
else Just $ Param "--buffer"
|
||||
]
|
||||
|
||||
start = do
|
||||
|
|
Loading…
Reference in a new issue