Add Support for bare repos

This is the real one now. I recloned and reapplied my changes, so hopefully, this one is less messy.

I added one test and ensured stuff passes.