public static function createFromOutputLine(Repository $repository, string $outputLine)
    {
        $slices = static::getLineSlices($outputLine);
        $fullPath = $slices['fullPath'];
        if (false === $pos = mb_strrpos($fullPath, '/')) {
            // repository root
            $path = '';
            $name = $fullPath;
        } else {
            $path = substr($fullPath, 0, $pos);
            $name = substr($fullPath, $pos + 1);
        }

        return new static(
            $repository,
            $slices['permissions'],
            $slices['type'],
            $slices['sha'],
            $slices['size'],
            $name,
            $path
        );
    }