gittest: Convert most tests that use worktrees
This MR converts most of our tests that use worktrees to instead use bare repositories together with helpers like gittest.WriteCommit()
which don't need a worktree in order to operate. This is done to bring our tests closer to the data we have in production, where repositories wouldn't ever have a worktree either.