Skip to content

Commit

Permalink
Split files based on /\R+/ regex (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Feb 5, 2025
1 parent 7afe4d2 commit 4182de5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/Repositories/GitPathsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4182de5

Please sign in to comment.