commit: add repository argument to lookup_commit_reference