public function getCommit($short = true, $path = null)
    {
        $short = $short ? 'h' : 'H';
        $path = $this->resolvePath($path);

        $process = new Process("git log --pretty=\"%$short\" -n1 HEAD", $path);

        if (0 === $process->run()) {
            return trim($process->getOutput());
        }

        throw GitException::process($process);
    }
public function getCommit($short = true, $path = null)
    {
        $short = $short ? 'h' : 'H';
        $path = $this->resolvePath($path);

        $process = new Process("git log --pretty=\"%$short\" -n1 HEAD", $path);

        if (0 === $process->run()) {
            return trim($process->getOutput());
        }

        throw GitException::process($process);
    }
public function getCommit ( $ short = true , $ path = null ) { $ short = $ short ? 'h' : 'H' ; $ path = $ this -> resolvePath ( $ path ) ; $ process = new Process ( "git log --pretty=\"%$short\" -n1 HEAD" , $ path ) ; if ( 0 === $ process -> run ( ) ) { return trim ( $ process -> getOutput ( ) ) ; } throw GitException :: process ( $ process ) ; }
Returns the current Git commit hash.

@param boolean     $short Get the short hash?
@param null|string $path  The repository path.

@return string The hash.

@throws GitException If there was an error using Git.
Returns the current Git commit hash .