public function __construct(Repository $repo, $commitish) { $this->repo = $repo; $object = $repo->getObject($commitish); if ($object instanceof Commit) { $this->commit = $object; $this->tree = $object->getTree(); } else { throw new EntityNotFoundException("Could not resolve commitish to a commit."); } }