aboutsummaryrefslogtreecommitdiff
path: root/Annex/Branch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-14 16:23:22 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-14 16:23:22 -0400
commit2e07411c7f08f789c217299b52ecf9bd57e6e86d (patch)
tree0b907bbca076a521ea29cdd413f84c7b11d5177d /Annex/Branch.hs
parent0ca84a5da638e4a5e0da02555819182b3b9de715 (diff)
Sped up git-annex merge by using git hash-object --batch.
This does mean that it has to write out temp files containing updated objects for the merge. So may use more disk space, and disk IO, but that should generally win out over needing to launch N separate git hash-object processes.
Diffstat (limited to 'Annex/Branch.hs')
-rw-r--r--Annex/Branch.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index a46a90ee9..d6735be88 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -50,6 +50,7 @@ import Git.Types
import Git.FilePath
import Annex.CatFile
import Annex.Perms
+import Annex.HashObject (hashObjectHandle)
import Logs
import Logs.Transitions
import Logs.Trust.Pure
@@ -342,8 +343,9 @@ genIndex g = Git.UpdateIndex.streamUpdateIndex g
mergeIndex :: JournalLocked -> [Git.Ref] -> Annex ()
mergeIndex jl branches = do
prepareModifyIndex jl
- h <- catFileHandle
- inRepo $ \g -> Git.UnionMerge.mergeIndex h g branches
+ hashhandle <- hashObjectHandle
+ ch <- catFileHandle
+ inRepo $ \g -> Git.UnionMerge.mergeIndex hashhandle ch g branches
{- Removes any stale git lock file, to avoid git falling over when
- updating the index.