Fix multi-line commit errors collapsing to a single line
What does this MR do and why?
Fixes multi-line server error messages (from secret push protection, GitGuardian, and CODEOWNERS checks) collapsing into a single run-on line in the commit changes modal. This is a follow-up to !250973 (merged), which surfaced the issue.
The error <p> in commit_changes_modal.vue rendered {{ error }} in a plain paragraph, which collapses newlines. Adding gl-whitespace-pre-line preserves newlines while collapsing runs of spaces — unlike pre-wrap, which would also preserve the leading indentation baked into terminal-oriented rejection strings.
The same <p> is shared by upload_blob_modal.vue, new_directory_modal.vue, and blob_edit_header.vue via the same create_commit JSON error path, so this fix covers all three.
Also renames gl-text-red-600 → gl-text-danger on this element, consistent with the sibling error element in the same feature and the wider codebase (62 usages vs 3).
Closes #618082 (closed)
Screenshot
- This MR meets the
definition of done
How to set up and validate locally
- Enable secret push protection or GitGuardian on a test project.
- Edit a file via the Web IDE or the repository file editor and attempt to commit a secret.
- Observe the rejection message in the commit changes modal — lines should now be separated correctly.
Related to #618082 (closed)
