Merge pull request #5943 from kcsaul/fix/5851 Fix worktree iteration when repository has no common directory