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

Screenshot_2026-08-20_at_6.21.03_PM

  • This MR meets the definition of done

How to set up and validate locally

  1. Enable secret push protection or GitGuardian on a test project.
  2. Edit a file via the Web IDE or the repository file editor and attempt to commit a secret.
  3. Observe the rejection message in the commit changes modal — lines should now be separated correctly.

Related to #618082 (closed)

Edited by Joseph Fletcher

Merge request reports

Loading
Loading