repository: refactor git related function

* Remove formatName function
* Add barePath function
repository: don't delete the repository

The old code was just buggy: we cannot delete the bare path, it loses
history :-) I know, I'm very stupid.