bug fix
authorJoey Hess <joeyh@joeyh.name>
Mon, 16 Nov 2020 18:57:51 +0000 (14:57 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 16 Nov 2020 18:57:51 +0000 (14:57 -0400)
really innefficient but it does solve dropping

Annex/AdjustedBranch.hs
doc/todo/update_adjusted_branch_on_content_availability_change.mdwn

index 4b28b04b8575dc48e363331c21f9a0f15eecd514..ea79a7f180cf618aae0f5b53fdf29120d15259c4 100644 (file)
@@ -44,6 +44,7 @@ import Annex.Common
 import Types.AdjustedBranch
 import Annex.AdjustedBranch.Name
 import qualified Annex
+import qualified Annex.Queue
 import Git
 import Git.Types
 import qualified Git.Branch
@@ -315,6 +316,11 @@ adjustedBranchRefresh _af a = do
        -- 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
 
index 133382e11bade5aef049002da5194b9dec12ec15..4898011540294bb9b4ddddeedcb0e9c7101204e4 100644 (file)
@@ -97,3 +97,14 @@ branch. That is not batched, so running once per file may get slow.
 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.)