Fix dead history on empty repository.

fixes #1078