Better behavior when dealing with repositories with empty commits, see #319