Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split files based on /\R+/ regex for --diff, same as --dirty #339

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Feb 3, 2025

/\R+/ matches any type of line break, including:

  • \n (LF - Unix/Linux)
  • \r\n (CRLF - Windows)
  • \r (CR - old macOS)
  • Other uncommon variations

PREG_SPLIT_NO_EMPTY: Prevents empty elements in the result when consecutive line breaks are found

NOTE: Same as dirty

$dirtyFiles = collect(preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY))

@taylorotwell taylorotwell merged commit 4182de5 into laravel:main Feb 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants