public function getPresentExportIgnoresToPreserve(array $globPatternMatchingExportIgnores)
    {
        $gitattributesContent = (string) file_get_contents($this->gitattributesFile);

        if (preg_match("/(\*\h*)(text\h*)(=\h*auto)/", $gitattributesContent)) {
            $this->hasTextAutoConfiguration = true;
        }

        $eol = $this->detectEol($gitattributesContent);

        $gitattributesLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $gitattributesContent
        );

        $basenamedGlobPatternMatchingExportIgnores = array_map(
            'basename',
            $globPatternMatchingExportIgnores
        );

        $exportIgnoresToPreserve = [];

        array_filter($gitattributesLines, function ($line) use (
            &$exportIgnoresToPreserve,
            &$globPatternMatchingExportIgnores,
            &$basenamedGlobPatternMatchingExportIgnores
        ) {
            if (strstr($line, 'export-ignore') && strpos($line, '#') === false) {
                list($pattern, $void) = explode('export-ignore', $line);
                if (substr($pattern, 0, 1) === '/') {
                    $pattern = substr($pattern, 1);
                    $this->hasPrecedingSlashesInExportIgnorePattern = true;
                }
                $patternMatches = $this->patternHasMatch($pattern);
                $pattern = trim($pattern);

                if ($patternMatches
                    && !in_array($pattern, $globPatternMatchingExportIgnores)
                    && !in_array($pattern, $basenamedGlobPatternMatchingExportIgnores)
                ) {
                    return $exportIgnoresToPreserve[] = trim($pattern);
                }
            }
        });

        return $exportIgnoresToPreserve;
    }