summaryrefslogtreecommitdiff
path: root/Annex/Direct.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 /Annex/Direct.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 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index b66b2fdfd..a6c30ad08 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -14,8 +14,8 @@ import qualified Git.Merge
import qualified Git.DiffTree as DiffTree
import Git.Sha
import Git.Types
-import Annex.CatFile
import Git.FileMode
+import Annex.CatFile
import qualified Annex.Queue
import Logs.Location
import Backend
@@ -45,8 +45,10 @@ stageDirect = do
{- Determine what kind of modified or deleted file this is, as
- efficiently as we can, by getting any key that's associated
- with it in git, as well as its stat info. -}
- go (file, Just sha) = do
- shakey <- catKey sha
+ go (file, Just sha, Just mode) = do
+ shakey <- if isSymLink mode
+ then catKey sha
+ else return Nothing
mstat <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file
filekey <- isAnnexLink file
case (shakey, filekey, mstat, toInodeCache =<< mstat) of