Test if it is possible to add files to the index of a bare repo.
Adding using a path should still require a non-bare repository.
Refactored the working tree dependant code for add.
Adding to a bare repository is now possible because @with_git_dir
is only used on the relevant methods.