sync, pre-commit, indirect: Avoid unnecessarily catting non-symlink files from git, which can be so large it runs out of memory.

This commit is contained in:
Joey Hess 2013-09-19 14:48:42 -04:00
parent 66b6a9cc4e
commit eb42bde19a
6 changed files with 26 additions and 14 deletions

View file

@ -18,6 +18,7 @@ module Logs.Web (
) where
import qualified Data.ByteString.Lazy.Char8 as L
import Data.Tuple.Utils
import Common.Annex
import Logs
@ -70,7 +71,7 @@ knownUrls = do
Annex.Branch.withIndex $ do
top <- fromRepo Git.repoPath
(l, cleanup) <- inRepo $ Git.LsFiles.stagedDetails [top]
r <- mapM (geturls . snd) $ filter (isUrlLog . fst) l
r <- mapM (geturls . snd3) $ filter (isUrlLog . fst3) l
void $ liftIO cleanup
return $ concat r
where