From 2b2d79da047e5f71e46723fb3535c753ba7ba561 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Mon, 3 Feb 2025 14:46:53 -0500 Subject: [PATCH] Split files based on `/\R+/` regex --- app/Repositories/GitPathsRepository.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Repositories/GitPathsRepository.php b/app/Repositories/GitPathsRepository.php index bf4c655b..64b09ba0 100644 --- a/app/Repositories/GitPathsRepository.php +++ b/app/Repositories/GitPathsRepository.php @@ -66,10 +66,8 @@ public function diff($branch) code: 1, message: 'The [--diff] option is only available when using Git.', )) - ->map(fn ($process) => $process->getOutput()) - ->map(fn ($output) => explode(PHP_EOL, $output)) + ->map(fn ($process) => preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY)) ->flatten() - ->filter() ->unique() ->values() ->map(fn ($s) => (string) $s);