I think there is an extension method _repository.Lookup<Commit>() - I would prefer that to a typecast, if it exists.