Bare repositories don't have indexes.

Fixes #2218.

Note that I don't know what I'm doing ;-). Maybe there's a rational reason to allow bare repos to have indexes, but I haven't (yet) found one.