Git fork

Merge branch 'sj/ref-contents-check-fix'

"git verify-refs" (and hence "git fsck --reference") started
erroring out in a repository in which secondary worktrees were
prepared with Git 2.43 or lower.

* sj/ref-contents-check-fix:
fsck: ignore missing "refs" directory for linked worktrees

+22
+3
refs/files-backend.c
··· 3762 3762 3763 3763 iter = dir_iterator_begin(sb.buf, 0); 3764 3764 if (!iter) { 3765 + if (errno == ENOENT && !is_main_worktree(wt)) 3766 + goto out; 3767 + 3765 3768 ret = error_errno(_("cannot open directory %s"), sb.buf); 3766 3769 goto out; 3767 3770 }
+19
t/t0602-reffiles-fsck.sh
··· 110 110 ) 111 111 ' 112 112 113 + test_expect_success 'no refs directory of worktree should not cause problems' ' 114 + test_when_finished "rm -rf repo" && 115 + git init repo && 116 + ( 117 + cd repo && 118 + test_commit initial && 119 + git worktree add --detach ./worktree && 120 + 121 + ( 122 + cd worktree && 123 + worktree_refdir="$(git rev-parse --git-dir)/refs" && 124 + # Simulate old directory layout 125 + rmdir "$worktree_refdir" && 126 + git refs verify 2>err && 127 + test_must_be_empty err 128 + ) 129 + ) 130 + ' 131 + 113 132 test_expect_success 'ref name check should work for multiple worktrees' ' 114 133 test_when_finished "rm -rf repo" && 115 134 git init repo &&