public function tree($ref = 'HEAD', $path = null)
    {
        if ($path instanceof NodeObject) {
            $subjectPath = $path->getFullPath() . ($path->isTree() ? '/' : '');
        }
        else {
            $subjectPath = $path;
        }

        $what = $ref;
        if ($ref instanceof TreeishInterface) {
            $what = $ref->getSha();
        }
        $this->clearAll();
        $this->addCommandName(self::LS_TREE_COMMAND);
        $this->addCommandArgument('-l');
        $subject = $what;
        $this->addCommandSubject($subject);
        $this->addPath($subjectPath);

        return $this->getCommand();
    }