gitindex: handle bare repos in plainOpenRepo (#1030)
If you set ZOEKT_DISABLE_GOGIT_OPTIMIZATION=true then zoekt-git-index
would fail on bare repositories. This was a regression from
a0f5789 Handle git indexing path correctly for Git worktrees
As such we also increase our test coverage to handle bare vs normal vs
worktrees. Additionally we add a test for when we disable the
optimization for bare repos, specifically targetting the regression we
saw.