aboutsummaryrefslogtreecommitdiff
path: root/Command/Indirect.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-19 14:48:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-19 14:48:42 -0400
commit2ec103cb68110deee36e8445d7320d0297ed4342 (patch)
treea57c1f474343773854f726b3ca3531af2d4cfbcd /Command/Indirect.hs
parent5f90fe2a343ba513682513d1b1b8019f85b1ac9f (diff)
sync, pre-commit, indirect: Avoid unnecessarily catting non-symlink files from git, which can be so large it runs out of memory.
Diffstat (limited to 'Command/Indirect.hs')
-rw-r--r--Command/Indirect.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Indirect.hs b/Command/Indirect.hs
index e63c4cb8a..79e736d11 100644
--- a/Command/Indirect.hs
+++ b/Command/Indirect.hs
@@ -14,6 +14,7 @@ import Command
import qualified Git
import qualified Git.Command
import qualified Git.LsFiles
+import Git.FileMode
import Config
import qualified Annex
import Annex.Direct
@@ -67,8 +68,7 @@ perform = do
{- Walk tree from top and move all present direct mode files into
- the annex, replacing with symlinks. Also delete direct mode
- caches and mappings. -}
- go (_, Nothing) = noop
- go (f, Just sha) = do
+ go (f, Just sha, Just mode) | isSymLink mode = do
r <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus f
case r of
Just s
@@ -80,6 +80,7 @@ perform = do
maybe noop (fromdirect f)
=<< catKey sha
_ -> noop
+ go _ = noop
fromdirect f k = do
showStart "indirect" f