Gitamin\Services\Git\Repository::pathExists PHP 메소드

pathExists() 공개 메소드

Return true if $path exists in $branch; return false otherwise.
public pathExists ( string $commitish, string $path ) : boolean
$commitish string Commitish reference; branch, tag, SHA1, etc.
$path string Path whose existence we want to verify.
리턴 boolean GRIPE Arguably belongs in Gitter, as it's generally useful functionality. Also, this really may not be the best way to do this.
    public function pathExists($commitish, $path)
    {
        $output = $this->getClient()->run($this, "ls-tree {$commitish} '{$path}'");
        if (strlen($output) > 0) {
            return true;
        }
        return false;
    }