From: Joey Hess Date: Mon, 16 Nov 2020 18:57:51 +0000 (-0400) Subject: bug fix X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~102^2~68 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=805af01562c72bbc61e675206b0858163484c58b;p=git-annex.git bug fix really innefficient but it does solve dropping --- diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index 4b28b04b85..ea79a7f180 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -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 diff --git a/doc/todo/update_adjusted_branch_on_content_availability_change.mdwn b/doc/todo/update_adjusted_branch_on_content_availability_change.mdwn index 133382e11b..4898011540 100644 --- a/doc/todo/update_adjusted_branch_on_content_availability_change.mdwn +++ b/doc/todo/update_adjusted_branch_on_content_availability_change.mdwn @@ -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.)