Fix accidentally regenerating whole history

This was caused by 9146334d738305f047586ea3aa21c2e292ae8be3 and would
regenerate repository history in each update where `HEAD` of the
repository did not change.