aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-01-12 10:03:02 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-12 06:55:41 -0800
commit9341740bea2ce334be412835fdcc0dd31550071a (patch)
treea9c7370709f2a2825aac2b2a14f1ba570ce8aff6 /contrib/persistent-https
parentrefs/reftable: extract function to retrieve backend for worktree (diff)
downloadgit-9341740bea2ce334be412835fdcc0dd31550071a.tar.gz
git-9341740bea2ce334be412835fdcc0dd31550071a.zip
refs/reftable: fix consistency checks with worktrees
The ref consistency checks are driven via `cmd_refs_verify()`. That function loops through all worktrees (including the main worktree) and then checks the ref store for each of them individually. It follows that the backend is expected to only verify refs that belong to the specified worktree. While the "files" backend handles this correctly, the "reftable" backend doesn't. In fact, it completely ignores the passed worktree and instead verifies refs of _all_ worktrees. The consequence is that we'll end up every ref store N times, where N is the number of worktrees. Or rather, that would be the case if we actually iterated through the worktree reftable stacks correctly. But we use `strmap_for_each_entry()` to iterate through the stacks, but the map is in fact not even properly populated. So instead of checking stacks N^2 times, we actually only end up checking the reftable stack of the main worktree. Fix this bug by only verifying the stack of the passed-in worktree and constructing the backends via `backend_for_worktree()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions