Returns the working tree if possible and the found repository is not bare or the git repository itself.