When generating a list of worktrees using the 'git worktree list --porcelain' command, a bare worktree only has 2 lines, whereas all other worktrees have 3 lines. Since we don't need to switch to the bare repo, we can safely ignore it. The new listing function will look for a branch listing and only add that to the list of worktrees.
worktree /tmp/ws-nvim/.repos/neogit.git
bare
worktree /tmp/ws-nvim/neogit-bare-worktree-listing-error
HEAD 2b770465b79dfe60898983ddfc897cdf08cf9d34
branch refs/heads/fix-bare-worktree-listing-error
worktree /tmp/ws-nvim/neogit-master
HEAD bae3412ea9ac31292e14e9090dde7cb118cd52c1
branch refs/heads/master
When generating a list of worktrees using the 'git worktree list --porcelain' command, a bare worktree only has 2 lines, whereas all other worktrees have 3 lines. Since we don't need to switch to the bare repo, we can safely ignore it. The new listing function will look for a branch listing and only add that to the list of worktrees.