private function fetchCommitCollectionByPath($path, GitRepository $git)
    {
        // git log --follow --name-status --format='%H' -- $path
        $log = $git->log()->follow()->revisionRange('--name-status')->revisionRange('--format=%H')->execute($path);

        \preg_match_all(
            "/^(?'commit'.*)\n+(?'criteria'[RC])(?'index'[\d]{3})\t(?'from'.+)\t(?'to'.+)\n/m",
            $log,
            $matches,
            PREG_SET_ORDER
        );
        if (!\count($matches)) {
            return [];
        }

        $logCollection = [];
        foreach ((array) $matches as $match) {
            $logCollection[] = \array_filter($match, 'is_string', ARRAY_FILTER_USE_KEY);
        }

        return $logCollection;
    }
private function fetchCommitCollectionByPath($path, GitRepository $git)
    {
        // git log --follow --name-status --format='%H' -- $path
        $log = $git->log()->follow()->revisionRange('--name-status')->revisionRange('--format=%H')->execute($path);

        \preg_match_all(
            "/^(?'commit'.*)\n+(?'criteria'[RC])(?'index'[\d]{3})\t(?'from'.+)\t(?'to'.+)\n/m",
            $log,
            $matches,
            PREG_SET_ORDER
        );
        if (!\count($matches)) {
            return [];
        }

        $logCollection = [];
        foreach ((array) $matches as $match) {
            $logCollection[] = \array_filter($match, 'is_string', ARRAY_FILTER_USE_KEY);
        }

        return $logCollection;
    }
private function fetchCommitCollectionByPath ( $ path , GitRepository $ git ) { // git log --follow --name-status --format='%H' -- $path $ log = $ git -> log ( ) -> follow ( ) -> revisionRange ( '--name-status' ) -> revisionRange ( '--format=%H' ) -> execute ( $ path ) ; \ preg_match_all ( "/^(?'commit'.*)\n+(?'criteria'[RC])(?'index'[\d]{3})\t(?'from'.+)\t(?'to'.+)\n/m" , $ log , $ matches , PREG_SET_ORDER ) ; if ( ! \ count ( $ matches ) ) { return [ ] ; } $ logCollection = [ ] ; foreach ( ( array ) $ matches as $ match ) { $ logCollection [ ] = \ array_filter ( $ match , 'is_string' , ARRAY_FILTER_USE_KEY ) ; } return $ logCollection ; }
Fetch the commit collection by the file path.

@param string        $path The file path.
@param GitRepository $git  The git repository.

@return array
Fetch the commit collection by the file path .