import Types.AdjustedBranch
import Annex.AdjustedBranch.Name
import qualified Annex
+import qualified Annex.Queue
import Git
import Git.Types
import qualified Git.Branch
-- because other files than the provided AssociatedFile
-- can need to be updated in some edge cases.
update adj origbranch = do
+ -- Flush the queue, to make any pending changes be written
+ -- out to disk. But mostly so any pointer files
+ -- restagePointerFile was called on get updated so git
+ -- checkout won't fall over.
+ Annex.Queue.flush
let adjbranch = originalToAdjusted origbranch adj
void $ updateAdjustedBranch adj adjbranch origbranch
And to write trees, it uses git mktree --batch. But, a new process is
started each time by Git.Tree.adjustTree (and other things).
Making that a long-running process would speed it up, probably.
+
+## queue flush slowness
+
+It uses Annex.Queue.flush to avoid a problem with dropping files,
+which depopuates the pointer file, which git sees as modified until
+restaged, which then prevents checking out the version of the branch where
+the pointer file is a symlink. There must be a less expensive way to handle
+that.
+
+(All the extra "(recording state in git...)" when dropping
+are due to it doing that too.)