Refactored the working tree dependent code for add.
Adding to a bare repository is now possible because @git_working_dir
is only used on the relevant methods.