head_commit can be null