Make detection of empty repo also work after a git gc