Skip to content

Commit

Permalink
fix(CommitCommand): Replace null with empty string in message
Browse files Browse the repository at this point in the history
- Replace the null value with an empty string in the message
- This change ensures that the message structure remains consistent and avoids issues with null values
- Improves overall handling of commit messages in the application
  • Loading branch information
ityaozm@gmail.com committed Nov 10, 2024
1 parent 6259be7 commit 1fbbf94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Commands/CommitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function ($attempts) use ($cachedDiff, $type): string {
return $content;
})
->tap(function (Collection $message): void {
$message = $message->put('', null)->sortKeysUsing(static function (string $a, string $b): int {
$message = $message->put('', '')->sortKeysUsing(static function (string $a, string $b): int {
$rules = ['subject', '', 'body'];

return array_search($a, $rules, true) <=> array_search($b, $rules, true);
Expand Down

0 comments on commit 1fbbf94

Please sign in to comment.