fix logging of git commit hash

Makes sure that hash is retrieved in the correct directory (repository).